How to double click on a special position of canvas html element with robotframework?

1,761 views
Skip to first unread message

hanih...@gmail.com

unread,
Nov 7, 2014, 10:53:03 AM11/7/14
to robotframe...@googlegroups.com
Hi everyone,
Does anyone know how to double click on a defined position (x,y) of a canvas with Robotframework?
I found by Googlinghow to execute JavaScript by Robotframework and to get the dimension of the canvas, but my problem is more than that:
I have a page with canvas.
On this canvas element, double mouse click on an exact position x,y will display some information.
What I want is to simulate this cas with robotframework.
Thanks in advance for your help.
Best regards,
Hani

Tatu Aalto

unread,
Nov 7, 2014, 11:02:03 AM11/7/14
to hanih...@gmail.com, robotframework-users

Ugh

I had similar needs in previous work, so I made Clik Element At Coordinates [1] keyword to Selenium2Library. Please note that it is quite common, at least in the past, that underlying selenium functionality is quite often broken with different browsers, browser versions and selenium versions.

-Tatu
Send from my mobile
[1] http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Click%20Element%20At%20Coordinates

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

hanih...@gmail.com

unread,
Nov 10, 2014, 4:01:31 AM11/10/14
to robotframe...@googlegroups.com, hanih...@gmail.com
Thank you so much for your answer. Can you please provide me your Click Element At Coordinates keyword ? Or give me the git link to it?


Le vendredi 7 novembre 2014 17:02:03 UTC+1, Tatu Aalto a écrit :

Ugh

I had similar needs in previous work, so I made Clik Element At Coordinates [1] keyword to Selenium2Library. Please note that it is quite common, at least in the past, that underlying selenium functionality is quite often broken with different browsers, browser versions and selenium versions.

-Tatu
Send from my mobile
[1] http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Click%20Element%20At%20Coordinates

On 7 Nov 2014 17:53, <hanih...@gmail.com> wrote:
Hi everyone,
Does anyone know how to double click on a defined position (x,y) of a canvas with Robotframework?
I found by Googlinghow to execute JavaScript by Robotframework and to get the dimension of the canvas, but my problem is more than that:
I have a page with canvas.
On this canvas element, double mouse click on an exact position x,y will display some information.
What I want is to simulate this cas with robotframework.
Thanks in advance for your help.
Best regards,
Hani

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

hanih...@gmail.com

unread,
Nov 10, 2014, 4:10:41 AM11/10/14
to robotframe...@googlegroups.com, hanih...@gmail.com
Oh sorry I didn't understand your point. The Click Element At Coordinates keyword of the library is not working for me.
My problem is that I have a diagram which is a canvas object and I need to be able to double click on each element of my diagram which is not possible using this keyword. In SeleniumLibrary there is a double click element but you can't specify the coordinates. Also when I use this keyword, I get an error saying that "no browser is open"! I tried the keyword with dont_wait argument but I still getting the same error, so 2 problems:
1) There is no keyword to double click on a specific coordinate
2) Even using the keyword without coordinates, returns an error "no browser is open"
Any idea?

Tatu Aalto

unread,
Nov 10, 2014, 10:38:59 AM11/10/14
to hanih...@gmail.com, robotframework-users

Ugh

1) Sorry, did not read your mail carefully enough, I was assuming single click operations. But currently there is not keyword to double click on elements coordinates. If I recall the code correctly, it should not be too hard to do the required keyword, if one understands the underlying selenium functionality. I think most hardest part is to write acceptance test for the feature.
2) If we are talking about the Click Element At Coordinates keyword, the x- and y-coordinates are mandatory parameters and error will be displayed if one does not specify them. Cannot recall what is the exact error in that case.

-Tatu
Send from my mobile

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.

hanih...@gmail.com

unread,
Nov 11, 2014, 3:30:18 AM11/11/14
to robotframe...@googlegroups.com, hanih...@gmail.com
Tatu,
indeed, adding a new keyword to Selenium2Library was easy. I just added a new keyword: "Double Click Element At Coordinates" by modifying the Selenium2Library._element.py and taking as example "click_element_at_coordinates" and "double_click_element".
Now I execute the double click on my canvas. But can not see if the keyword has really double clicked on my canvas. The report.html shows that the click has been done, but I'm not able to see it.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Tatu Aalto

unread,
Nov 14, 2014, 1:56:05 AM11/14/14
to hanih...@gmail.com, robotframework-users

Ugh

Well hard to say. Are the errors, also remember to run test with trace level enabled. Could you share the code snippet? It might be also browser issue or the selenium functionality is broken.

-Tatu
Send from my mobile

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages