I've tried to find a way how to get the IWebElement's position (images in particular) and use it in my C# tests. So far the only example I was able to dig in is in Python. Is there such org.openqa.selenium.Dimension equivalence for C# ?
Asked
Active
Viewed 1,677 times
0
-
2Hope [this](http://selenium.googlecode.com/git/docs/api/dotnet/html/Properties_T_OpenQA_Selenium_IWebElement.htm) is what u r looking for... – Vivek Singh Mar 23 '15 at 10:22
-
Not quite, but I guess the combination of IWebElement.Location and IWebElement.Size will do the trick. Thanks for the tip. – ekostadinov Mar 23 '15 at 10:34
-
Well that's precisely how the other language bindings would have you do it too and it's how it's shown in your linked question also - a combination of the location & size. – Arran Mar 23 '15 at 13:56
-
I was kinda looking for an encapsulated solution, but I'll wrap it my self. – ekostadinov Mar 23 '15 at 15:42
1 Answers
0
You can try this JS code:
$('#<element id>').position().top.toString() + ',' + $('#<element id>').position().left.toString()

user3734429
- 322
- 1
- 10