How to find records in a field having scroll bar?

Asked by Nikhilesh

I want to search a record in a drop down list.That drop down list has a scrollbar & the scrollbars length depends upon the no. of records present in the list.
I tried with creating a region & then finding a pattern in the same but it not working.
Can youp lease help me in this matter?

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
RaiMan (raimund-hocke) said :
#1

To find something in a drop down list, is nearly impossible in current Sikuli, because find("some-text") is not reliable and (my experience) not usable in most cases for this (font not readable).

The only situation, that might work: you know the content of the list entries and based on this navigate to the entry.

If it is a webpage, have a look at the page source (find and evaluate the drop down element) or use Selenium.

Revision history for this message
Matt Pappas (matt-pappas) said :
#2

I've used the simple convention below with some success. In my case, I'm trying to find an item in a drop down list whose position can vary. I first click on the drop down box to open it. The script then looks for object.png, and if it doesn't find it, it keeps typing the down key until it does. The objects that the script is inspecting are quite similar (i.e. History TY, History LY, History LLY, etc.) so I had to increase the similarity degree to .80 or so.

click(object.png)
while not exists(object.png):
    type(Key.DOWN)

    if exists(object.png):
        click(object.png)
        type(Key.ENTER)

Can you help with this problem?

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

To post a message you must log in.