Selecting a value from combo box

Asked by Muhammed

Hai,

Can any one please tell me how can i select a value from the combo box (Drop down list). I cant type the string in the combo box , only thing is up and down key as well as mouse movement.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
akbar (mohammed-akbar-ali) said :
#1

Option1:-
Do a click on the list object and then click again by passing the text value of the list option. Last time i used such thing was with the previous version of Sikuli and it did not work consistently.

Option2:-
Click on the list object, perform key down, perform ENTER. Most of the times the selected value gets highlighted. You can copy it clipboard and compare for required selection text. Put the entire logic in a loop till required value is selected.

Revision history for this message
Muhammed (muhammed-k) said :
#2

Dear Akbar,

Option 2 is fine, but there is some complexities :-

1) List is very large for validation

2) The highlighted or selected value is not coming to the clip board manually also.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Is the content of the list known and fix?

If yes, simply counting the KeyDown actions until a specified step value is reached might work.
The needed steps are evaluated before based on the known content and the target entry.

Possible to have a look at that on the net somewhere?

Revision history for this message
akbar (mohammed-akbar-ali) said :
#5

1) List is very large for validation - You can press the first letter of the required value and then do the looping logic.

What about the first option? Only other option i can think of is what Raiman has suggested.

Revision history for this message
Muhammed (muhammed-k) said :
#6

Hi Akbar,

We can not type any thing in the combo box. Only Up and Down Arrows are working.

Hai RaiMan,

List contains the Country Names, it is static. But the thing is in some scenarios there will some country selected before our program started to execute.

So by default in our sikuli script we have to take the control to the first item so that we can put it in the loop by knowing the count.

Is there any way to reduce this step.

Revision history for this message
RaiMan (raimund-hocke) said :
#7

Clearly no.
But I think with a fixed/known list, this is rather easy.

Exception:
you try with Region.text() or take an image of every list item (which can be automated).
But both solutions heavily depend on, that in all cases the displayed font is the one when developing the script.

Revision history for this message
anupama kapoor (anu-only) said :
#8

Hello,

I faced the same problem.

I also have a combo box with list of countries.
I cannot select one from list of many.
But my combo box helped me by selecting the particular country.

How?
Reach upto the combo box
then pass the command type ('united kingdom")(I tested it manually to confirm and it worked)
united kingdom was selected.

Hope u understood it and will help u

Can you help with this problem?

Provide an answer of your own, or ask Muhammed for more information if necessary.

To post a message you must log in.