xOffset & yOffset in WebDriver

1,328 views
Skip to first unread message

Kumar

unread,
Aug 17, 2012, 2:17:15 AM8/17/12
to seleniu...@googlegroups.com
Hi,

I am using Actions class to use moveToElement().
However, I want to know what is xOffset and yOffset as parameters to this method?
How can I get  xOffset and yOffset  from a web page?

Thanks,
Kumar

Anji Prassana

unread,
Aug 17, 2012, 2:36:23 AM8/17/12
to seleniu...@googlegroups.com
if you wanna recognize the element by coordinates instead of its id,xpath etc.. you use this function.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/26vufZucCXcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks&Regards
Anjaneyulu P
"The way you see the things is the way to think and is the way you react upon!!"

Kumar

unread,
Aug 17, 2012, 2:39:44 AM8/17/12
to seleniu...@googlegroups.com, anji...@yahoo.co.in
You mean x coordinates and y coordinates?

If yes, how can I get it for an object/element?

Thanks,
Kumar

Anji Prassana

unread,
Aug 17, 2012, 7:42:47 AM8/17/12
to seleniu...@googlegroups.com
  • getLocation() function will retrun that...

  • getLocation

    Point getLocation()
    Where on the page is the top left-hand corner of the rendered element?
    Returns:
    A point, containing the location of the top left-hand corner of the element

  I mean, driver.findElement(By.xpath(...)).getLocation() will return the co-ordinates in the form of point object



To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DbYYcDQsid4J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages