简体   繁体   中英

Selenium: How to find which element to click in a custom jquery plugin generated select box

I am trying to automate a click on the multiple select dropdown in this example: http://davidwalsh.name/dw-content/jquery-chosen.php

I am sending the click event to the li element with the class "active-result" (after clicking on the element that says "Select Frameworks...").

The issue is that the li element doesn't have the onclick handler, so the option is not added to the list. How can I find the element that actually has the onclick handler in order to perform the action?

Found out by searching the code that the element didn't have an onclick handler, it actually was listening for a mouseup event. So I modified my test to use: selenium.mouseup().

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM