Using Selenium to 'click' on non-input or non-control elements

喜你入骨 提交于 2019-12-05 20:29:49

Have you tried adapting a Mouse Listener? In case you are extending Selenium using Java, here is a quick tutorial.

Have you tried fire_event(locator, 'click') instead of 'onclick'?

Karthi

Have you tried tweaking fire event? As you are mentioning it as plain text locator of this should be like //p[contains(text(),'yourtext')] something like this. Try it once.

A native .click() event should work fine if your using Firefox 31.6.0 ESR (not a later version), or if your using Chrome. Keep in mind that for any event where a physical mouse click is not working for you (for whatever reason), you can still call a JavascriptExecutor to click the element (which is referred to as a synthetic non-native Selenium event).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!