Has anyone been successful with getting Selenium to issue a mouse click on an element which is not associated with input, i.e. plain text? I have tried using click() and click_at() methods, as well as fire_event(locator, event), where 'event' is 'onclick', or by using combination of 'onmousedown' and 'onmouseup' events. I have also tried preceding these events with an 'onmouseover' event. In my app, clicking on this 'plain text' triggers a call to a flash.swf routine. Thanks.
Asked
Active
Viewed 1,846 times
3
-
Can you post a part of html on which you are trying clicking? – Sergii Pozharov Feb 19 '11 at 14:10
4 Answers
0
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).

djangofan
- 28,471
- 61
- 196
- 289
0
Have you tried adapting a Mouse Listener? In case you are extending Selenium using Java, here is a quick tutorial.

rs79
- 2,311
- 2
- 33
- 39
-
This will not work in this case - Mouse Listeners are for AWT/Swing applications – Sergii Pozharov Feb 19 '11 at 14:11
0
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.

Jason Plank
- 2,336
- 5
- 31
- 40

Karthi
- 479
- 2
- 9
- 21