Click a particular X and Y co-ordinates in the browser pane by using watir webdriver

891 views
Skip to first unread message

Srinivas Desai

unread,
Aug 2, 2013, 1:40:46 AM8/2/13
to watir-...@googlegroups.com
Hi All,

I need to know how can we click on a particular x and y co-ordinates in the browser pane by using watir web driver.
I already have x,y co-ordinates with me, i just need to click.
Please let me know how it can be done.

Thanks in advance.

Regards,
Srinivas.


John Fitisoff

unread,
Aug 6, 2013, 7:54:17 PM8/6/13
to watir-...@googlegroups.com
Think what you need is here:

http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/WebDriver/ActionBuilder.html

Watir's browser object has a method to access the driver and page elements have the wd method


From: Srinivas Desai <desai...@gmail.com>
To: watir-...@googlegroups.com
Sent: Thursday, August 1, 2013 10:40 PM
Subject: [wtr-general] Click a particular X and Y co-ordinates in the browser pane by using watir webdriver

--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general
watir-genera...@googlegroups.com
 
---
You received this message because you are subscribed to the Google Groups "Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Chuck van der Linden

unread,
Aug 7, 2013, 7:11:27 PM8/7/13
to watir-...@googlegroups.com
using specific x,y coordinates is perhaps one of the best ways to create a brittle hard to maintain script.  running the script on a different system with different browser size, zoom level, site re-designs, etc  all can break the script.

Is there a specific reason you are trying to do things this way?  Normally there are far better ways to figure out where to click.  And where those don't work there are tools like Sikuli that work visually which are still usually a better alternative to a fixed X,Y based action

Srinivas Desai

unread,
Aug 12, 2013, 2:39:09 AM8/12/13
to watir-...@googlegroups.com
Yes the main reason why am doing this way is none of the objects are recognizable. But i have x,y coordinates of all the objects. If i click an object that will result in a popup and i have to test the popup results also.
This is the main reason am completely depending on this approach.

Mariano Giagante

unread,
Aug 13, 2013, 8:33:24 AM8/13/13
to watir-...@googlegroups.com
Maybe that'll be better than browsing the link directly. At least you're testing the button.

I'm new to this, but as far as I know, the way you can refer items in a webpage is pretty code-dependant. Maybe you should ask the developer for help on how to identify those elements.
If it's shown after a mouseover or another event, you can use the fire_event method of the element class (inherited by all elements).

Hope it helps.

Super Kevy

unread,
Aug 13, 2013, 9:28:23 AM8/13/13
to watir-...@googlegroups.com
Is it an HTML object like  area ?  is it an embedded object like flashplayer?

Srinivas Desai

unread,
Aug 14, 2013, 4:59:54 AM8/14/13
to watir-...@googlegroups.com
No its not an HTML object or flash, we are using some internal tool which will render the view by parsing an XML file.

Super Kevy

unread,
Aug 15, 2013, 9:43:20 AM8/15/13
to watir-...@googlegroups.com
So we ruled out two types of things its not (HTML or FLASH). 
Is it Silverlight, Applet or is this some special plugin?    
Is the object in an HTML embed element block?

You need to provide more information.  Can the object take focus, can it be tabbed. Does it have keyboard shortcuts.  
What are you trying to do with the object?

is199 BY

unread,
Dec 12, 2013, 1:33:57 AM12/12/13
to watir-...@googlegroups.com
Hi All,

This is chinnu...Please let me know how to click on an HTML element based on the X,Y coordinates...

First of all let me know how to find the co ornidates of an HTML elemenet I am using Watir-Webdriver ruby....

Please help me....

is199 BY

unread,
Dec 12, 2013, 1:34:32 AM12/12/13
to watir-...@googlegroups.com


On Friday, August 2, 2013 11:10:46 AM UTC+5:30, Srinivas Desai wrote:
Reply all
Reply to author
Forward
0 new messages