How to fill a Flex Combo Box

Class library usage, coding and language questions.
adietlicher
Posts: 1
Joined: Mon Jul 25, 2011 3:20 pm

How to fill a Flex Combo Box

Post by adietlicher » Mon Jul 25, 2011 3:43 pm

Hi

I try to find the best way to select values in a Flex Combo Box. There are 3 different ways I have identified:
- Opening the combo box and selecting the appropriate value (including scrolling) using the mouse.
- Filling the text to the text field part using the keyboard
- Setting the text using

Code: Select all

combobox.TextValue=text;
The first one is the slowest.
The second one is slow too, because I have to reduce replay speed since the keyboard inputs interfere with the auto completion functionality of the combo box. Additionally I have to take care of default text that might be present in the combo box which results in code like this:

Code: Select all

combobox.PressKeys("{LControlKey down}{Akey down}{LControlKey up}" + text + "{ENTER}");
Due to execution speed I would like to use the last of the three options. When looking at replay it seems the values are filled in but somehow they are not properly propagated behind the scenes as I get an error message telling me that I'm not allowed to save a null value...

Any ideas or best practices?

Thanks
Andreas

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: How to fill a Flex Combo Box

Post by artur_gadomski » Tue Jul 26, 2011 8:01 am

I haven't worked with Flex but for other combo boxes present in my AUT. I tried with getting a list of items and just calling select on the one I needed, but that didn't seem to work in some cases so i've moved on to expanding a combo box, selecting an item and pressing 'Tab' to move the focus away from combo box to confim selection.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to fill a Flex Combo Box

Post by Support Team » Tue Jul 26, 2011 1:38 pm

adietlicher wrote:Due to execution speed I would like to use the last of the three options. When looking at replay it seems the values are filled in but somehow they are not properly propagated behind the scenes as I get an error message telling me that I'm not allowed to save a null value...
Setting the TextValue directly means that Ranorex will use some technology dependent method to set the text. Whether the application correctly reacts to setting the TextValue is again technology and control implementation specific. Consequently, this is not real black-box testing, since a human user could never do the same, and we usually recommend using only mouse and keyboard inputs.
adietlicher wrote:Opening the combo box and selecting the appropriate value (including scrolling) using the mouse. ... The first one is the slowest.
IMHO that should not be that slow. Make sure you have the turbo mode switched on for your recording. If using user code, make sure to set the following constants to a low value:
Mouse.DefaultClickTime = 0;
Mouse.DefaultMoveTime = 0;
Keyboard.DefaultKeyPressTime = 0;
Delay.SpeedFactor = 0.0;
Regards,
Alex
Ranorex Team
.
Image