1

There is a drop down list in application where you can see (in drop down area) only ~5% of all the elements. So I can not find the way to select random value from the list.

enter image description here

Selection of random item

I am working with UFT(QTP) where it is done the next way: get list items count, generate random value according to the quantity of elements and select item by index in list.

But Sikuli works only with what is seen on the screen, so how can I select random item?

The same problem with Java Table.

1

This going to be a bit cumbersome.

The screenshot shows the list, just opened, with the scroll position indicator touching the top arrow up. There are 8 elements visible.

Pseudo code:

Until list scroll position indicator touches bottom arrow down:
- Click list arrow down
- Add one to list_scroll_count
Endloop

Scroll back up
Select random_number between 0 and list_scroll_count
Scroll random_number down
Generate random_position between 1 and 8
Click list item random_position
| improve this answer | |
  • If this is the simplest solution it's definitely better to use tools with descriptive access to elements then screen recognition tools. – Ivan Gerasimenko May 10 '16 at 8:19
  • So true. I'm currently on a hybrid environment of Sikuli and Autoit. Maybe someone will come up with a better solution? – Bookeater May 10 '16 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.