Reputation: 2746
I'm facing problem, that keyword "Click Element" doesn't always work correct.
For example, I want to go to the link on the web-site.
xpath for the Link is the:
${xpathIMButton} xpath=//a/span[contains(text(),"${exprIM}")]
${exprIM} Infrastructure Management
To click on the Link with Mouse Over I use following:
Wait Until Page Contains Element ${xpathIMButton}
Mouse Over ${xpathIMButton}
Click Element ${xpathIMButton} don't wait
That's pretty simple, but what I see on the Logs is confusing:
The screenshot from HTML-source of the button:
So, the Robot finds the link (Wait Until Page Contains Element and Mouse Over) are OK, but the Click Element fails. On the screenshot I can see, that the button actually exists. So what is the problem? Why I get those confusing error?
I'm using: RFW 2.7.5 SeleniumLibrary 2.8.1 Firefox 12
Upvotes: 2
Views: 6956
Reputation: 412
It seems that your Mouse Over could cause the issue. The Mouse Over could cause the element to be hidden in DOM.
But this was 6 years ago with Selenium 1 Library. Now, we are using Selenium2Library in ROBOT Framework, so if you give a try or already done it, just let us know.
Upvotes: 0
Reputation: 2149
It may be a little late to provide an answer, but I had exactly this problem. What I did was to provide a bit waiting time for the page to fully load, then my button was successfully found.
Upvotes: 0
Reputation: 1
Click Element
started to fail for me when I upgraded to Selenium 2.35, SeleniumLibrary 2.9.1 and Selenium2Library 1.2. My browser was Firefox 22. The Click Element
was pressing a Save button. The same exact code worked 2 times and the third time said it worked but the confirm page never showed up. I solved my issue by putting a Focus
keyword before my Click Element
Focus ${saveRule}
Click Element ${saveRule}
Now the code works the three times it is called. Hope this helps.
Upvotes: 0
Reputation: 4071
Try this:
Wait Until Page Contains Element ${xpathIMButton}
Mouse Over ${xpathIMButton}
Click Element ${xpathIMButton} don't wait
Upvotes: 0