Drop down menu on web page.

Asked by codeyogi

I want to use Sikuli to automate something on a webpage that contains a drop down menu.

There are two problems.

First, "click" is a mouse-down/mouse-up.

Second, there is no way to take a screenshot of the item in the drop down because as soon as you release the mouse to go click over to sikuli the menu closes.

Is there are work around for this? How can I:

1) left click a drop down on a web page
2) select an item from the list

Thank you very much

Great application!

codeyogi

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

3 possibilities:

1. use a screenshot tool to get a picture of the opened menu and load this picture in the IDE with the top middle button

1. if its possible, to use key-down to traverse the menu, just use a sequence of type(Key.DOWN) to get to the entry and then type(Key.ENTER).

2. use a calculated click():
menu = find(<pic1 of your menu closed>))
click(menu) # opens menu
entry = Match(menu.GetX() + x, menu.GetY() + y, w, h, 1)
click(entry)

x and y have to be the relative distance in pixel between top left corner of pic 1 and a imagined screenshot of your entry with a given width w and height h, so that the center of the square hit the entry with the click. Sounds complicated, but works well. Will be even more convenient in 0.10.

Revision history for this message
Robert (brockr) said :
#2

If you are running on a PC, change the Quick Capture hotkey to be a ctrl + something rather than its default alt + something. Navigate to the drop down menu you're interested in, and hit the ctrl + something key combination. The menu should stay visible and you should be able to snap a picture.

If you are running on a MAC ... no idea, but it might be something similar.

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

Yes, Robert, you are right. Using the "Quick Capture Hotkey", should work in most cases. If the menu reacts on the standard key combo, you can try to use another one.

This approach is true for Mac also. I missed this in my suggestion above, because on a Mac you already have a screenshot tool (Shift-Cmd-4), which has more options and is more accurate (shows pos and dim) and you can use it according my first suggestion. And it definitely does not interfere with anything thats going on on the screen.

Revision history for this message
droid8622 (droid8622) said :
#4

launch picasa - then use "prt scr " key)

Revision history for this message
harlan mosley (hmosley) said :
#5

I have a similar issue, but the application (old Delphi) doesn't display the popup menu when keypress down is done; has to be click, then the menu has about 20 selections. I can use the timing delay to successfully record the popup menu selection, but the event (spawns another application process) never occurs. The sequence is Run->Schedule. Any suggestions?

Can you help with this problem?

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

To post a message you must log in.