Repository navigation
Description
"Mouse Over" keyword seems not working in google chrome. We are getting an error mentioning below
"WebDriverException: Message: u'Element is not clickable at point (-12789, 222.5)'
The same script with "mouse over" keyword which is not working in google chrome is working very fine in Firefox.
during the script run in firefox we could clearly see the mouse overing and the drop down components getting dropped and selected. but this is not happening in google chrome. the mouse over is over on the HTML element but the corresponding list which need tto be drop down on mouse over is not happening. In the robot script execution the "mouse over" keyword is executed and passed but the subsequent keyword (selection of an item from drop down) is failing with the error "WebDriverException: Message: u'Element is not clickable at point (-12789, 222.5)' .
Note: the same script which is failing in chrome is working seemlessly in firefox.
Could any correct / comment on this issue?
The entire div with link1 link2 and link3 looks as below.
I replaced "<" & ">" with "[" & "]" in the below div tag html element, as i am not able to see the below code as code in the Git comment.
For u r information
The html element with id 2 is an [a] tag which is inside a [li] tag
[div class="top_Level_link"]
[ul id="MenuBar" class="MenuBarHorizontal MenuBarActive"[
[li id="link1"]
[li id="link2"]
[li id="link3" class="noborder"]
[a id="Html Element Id 1" class="MenuBarItemSubmenu" href="#" tabindex="-1"]Html Element Id 1[/a]
[ul class=""]
[i id="link4"]
[a id="Html Element Id 2" class="" href="xxxxxxx.jsp" tabindex="-1"]Html Element Id 2 [/a]
[/li]
[li id="Html Element Id 3"]
[/ul]
[/li]
[/ul]
[/div]
Hi @srib4ufrnd,
I think the usage of the simulate (Simulate "HTML element ID 2" Click Link) keyword [1] is wrong. This keyword executs an javascript event. And the second argument expects an event like onclick, onmouseover, etc and you just need the part without the 'on'. just "click" as second argument. And just make sure, like emanlove already mentioned, that the dom is completely loaded before start actions on elements.
Hope it helps!
Best regards,
Vall0n
[1] http://rtomac.github.com/robotframework-selenium2library/doc/Selenium2Library.html#Simulate
Thanks a lot Vallon
u r right.
we changed our test case as us suggested, It is working fine now and our test case is pass.
we are now able top hover on Html Element Id1 and we are able to click on Html Element Id 2.
our test case looks as below now
Mouse Over "HTML element ID 1"
Focus "HTML element ID 1"
Simulate "HTML element ID 2" click
This is working great in chrome :-) But not in Firefox :-(
any how we are using a conditional code in out test case as of now which is working fine for us.
Just for information..........Our test case looks as below now.
runKeywordIf $browser == firefox Execute User Defined robot keywords For FireFox
runKeywordIf $browser == gc Execute User Defined robot keywords For Chrome
where the user defined keywords looks as below
Execute User Defined robot keywords For FireFox
Mouse Over "HTML element ID 1"
Click Link "HTML element ID 2"
Execute User Defined robot keywords For Chrome
Mouse Over "HTML element ID 1"
Focus "HTML element ID 1"
Simulate "HTML element ID 2" click
Our problem is solved now :-) Thank u all for the support.
It would be great if any one suggest a common solution (robot keyword code) which works fine in all the browsers IE, FF, GC.
so that we can avoid the conditional statement as well :-)
Hi,
I also faced the same issue in chrome.
Thanks for the solution. It solved my problem too.
But as @srib4ufrnd said, it would be better if we had a common solution for all browsers.
could any one please suggest any common solution? it would be great.
Thank you.
I have a similar issue. I want to retrieve the text on pop up which changes on hovering, I tried with
Mouse Over xpath1
Focus xpath2
Get Text xpath2
But displays blank.
When i tried to get the attribute value it displays, i.e i tried getting id value, but does not display the text.
Could any one please help?
This issue hasn't seen any action in a while. I'm going to close it.
If anything new comes up please open a new issue.
Activity
emanlove commentedon Oct 9, 2012
@srib4ufrnd: That position seems awfully large, -12789, and in the negative too. Make sure you are using number type for arguments to the 'Mouse Down' keyword.
For example usage should be like
noting that the arguments are using the number format ${ }. If you have something like
then your arguments 100, 75 are strings and not numbers for which Robot Framework will convert those arguments to numerical position, in this example convert ("100", "75") to (68100, 7875) which is not what you wanted.
srib4ufrnd commentedon Oct 11, 2012
Thank a lot @emanlove for u r explanation.
But in our script we are not actually using Mouse Down or Mouse UP.
The keywords we are using is "Mouse Over" & "Click Link" and we are using "mouse over" and "click link" with id based locator (not coordinate based).
Our purpose is we have a HTML element with ID 1. When user mouse over on this HTML element user will get a drop down list with 2 different HTML elements with ID 2 and ID 3. Now user want to click on HTML element with ID 2.
so we are trying as below
for example: our keywords looks as below
Mouse Over "HTML element ID 1"
Click Link "HTML element ID 2"
when we try this "Mouse over" keyword is pass and success.
we can also observe a mouse overing action on the HTML element with ID1. Robot framework is doing this fine.
But we are facing an issue with "click link" as below:
INFO Clicking link 'XXXXXXX'.
FAIL WebDriverException: Message: u'Element is not clickable at point (-12789, 222.5)'
so finally the point what i would like to convey is when i am trying to click on link following mouse over then only we are getting an issue with click link.
if we are trying the same click link keyword alone on another HTML elements which doesn't require any mouse over then the click link keyword is success.
So we guess the problem is with mouse overing, but we are not sure, we need u r expert suggestion :-)
strange thing is........
when we are running the same scripts we are getting this problem only for chrome,
for the same scripts we are not getting this error in IE and FF.
In IE and FF these same keywords are working fine in combination and is success.
Please provide u r suggestions...
emanlove commentedon Oct 11, 2012
@srib4ufrnd: Given your description that you have some AJAX actions which occur in series one after another and that your tests work on some systems and not others you could be experiencing some timing issues. You might try waiting between the hover and click. There are several ways to do this including several "Wait ..." commands within the Selenium2Library and some keywords within Robot Framework builtin libraries. Also note the "Timeouts" section under Introduction within the Selenium2Library keyword documentation.
There is also implicit wait but I am debating with myself as to whether or not this will help. Implicit wait will check to see if an element is present and if not will poll for the element till it either finds it or times out. In you case the link seems to be there but the click location seems way off. So I am not sure if implicit wait in this case will say yes it is there before its position is really set. Personally I lean towards using implicit wait as it has saved me a few times when dealing with timing issues.
If you set implicit wait on library import do note it changes how tests check each time it tries to find and element but does not initially find it. So you can also try
srib4ufrnd commentedon Oct 15, 2012
Hi @emanlove
Thanks for ur suggestion but the solution is not working for us :-(
is there any way where we can say the "mouse over" keyword to stay on the same position for more time?
emanlove commentedon Oct 19, 2012
@srib4ufrnd Do you have a test page you can share?
Vall0n commentedon Dec 6, 2012
Hi,
I had a similiar problem. Maybe you can try the following:
Mouse Over "HTML element ID 1"
Focus "HTML element ID 1"
Simulate "HTML element ID 2" click
This workaround worked for me. Hope it Helps!
Best regards,
Vall0n
srib4ufrnd commentedon Dec 7, 2012
Hi VallOn
Thanks a lot for the reply,
we have written our test as suggested by u and as below, but still no luck :-( we are using chrome.
Mouse Over "HTML element ID 1"
Focus "HTML element ID 1"
Simulate "HTML element ID 2" Click Link
For u r information
The html element with id 2 is an tag which is inside a
finally we will have a web page which has 3 horizantal elements
link1 link2 link3
link3 (which has tag with id Html Element Id 1)is the one on which i have to mouse over which shows me a drop down list of two links again
But the code we tried above is not working.
can u tell me any thing extra u did or we any thing extra we need to take care?