Sikuli with Flash GUI and postgresql question

Asked by Ninja Mustang

Hello,
I have this scenario.
Dropdown list pulling info from postgresql db
Flash GUI giving user to select certain value and then click apply.
The Flash GUI allows me to TAB into that dropdown and DOWN.KEY to navigate to that list.

Droplist example
1
2
3
4

So let's say I want to match a value from an user input, 3 for example, then it arrows up or down to find a match and select 3.
Can this be done in just Sikuli IDE and python? Then I can just use Sikuli to click on OK image button.
Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

there are many answers in this forum on different situations and solutions.

If you know the fixed content of the list, then it is just starting from a defined beginning and counting down steps.

What I do not understand:
So let's say I want to match a value from an user input ...

When using Sikuli you normally simulate user actions, so you should know, what you enter.

Revision history for this message
Ninja Mustang (ninjamustang) said :
#2

I meant to say pre-defined value, say value 3 from a config.txt file and like you said, I do know the fixed content of the list. Example list [1, 2, 3, 3, 3, 4, 5, 6, 9].

So my question is when my pre-defined value 3 matches 3 in the list, it will do push out that value until there is no more match?

Would a push and pop function work in this case? The dropdown list will be less each time I push out value 3, until there is no more 3 left.

Thanks again RaiMain!

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

if we are talking about the Python list:
vals = [1, 2, 3, 3, 3, 4, 5, 6, 9]

then you can do this
while True:
    try:
        vals.remove(3) # removes the left most 3
        print "found", vals
        # 1st: [1, 2, 3, 3, 4, 5, 6, 9]
        # 2nd: [1, 2, 3, 4, 5, 6, 9]
        # 3rd: [1, 2, 4, 5, 6, 9]
     catch:
        # no 3 in vals
        print "not found", vals
        # 4th: [1, 2, 4, 5, 6, 9]
        break

... but if you are talking about finding the 3 visually in an opened drop down list, then this is possible, but very complex:
- divide the list in even rows each representing an entry
- try to read the number with Region.text() (good luck ;-)
- inspect next entry if necessary

Revision history for this message
Ninja Mustang (ninjamustang) said :
#4

ok, i'll see whether I can get the region.text() to work. Thanks again!

Revision history for this message
Ninja Mustang (ninjamustang) said :
#5

Thanks RaiMan, that solved my question.