I think that I may be asking something that has been answered, But I really can't tell. (a-hem) Here's my problem (This is an example... my site is behind a login) Go to www.humana.com. Hover over the text "Insurance Through Your Employer >" You will note that it was "hiding" more options... (But is not a classic dropdown menu) Say, I want to test the products-and-services function (not the actual page, but how this menu works.... no fair dodging the Q (grin)) If I try "clickAndWait" with "link=products-and-services" I get an error, because the test tool can't "see" the element.... (PHPUnit user, if it helps)
Is there a way to have the "mouse" "Hover" over element "A", and then, "Select/Click" on Element "B"?
To answer your question as it was mentioned in the title:
In your browser, open the drop-down, while the inspector is ON, click on one of its elements so that you will be guided to the right section of the HTML code. You should be directed to a set of ul
, li
tags. Having the XPath found in this way, a single command like the example below should serve the goal:
command:
clickAt
Target:
//ul[@id='select-area-map-menu']/li[2]
To answer your hover and click question:
Use clickAt
command in the same way (but NOT for the select tag). For instance:
clickAt | //a[@id='button-id'] |
This will click on a drop-down as if a user cliked on it to open. You can use many commands to trigger many actions then. For instance, mouseDown
command to click. However I think the first part of my answer is enough if the problem is that the drop-down was hidden.
I was dragged here by google since I had the same question. I am not an expert but I hope this answer works for others just fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.