0

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# ?

4
  • 2
    Hope this is what u r looking for... Mar 23, 2015 at 10:22
  • Not quite, but I guess the combination of IWebElement.Location and IWebElement.Size will do the trick. Thanks for the tip. Mar 23, 2015 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, 2015 at 13:56
  • I was kinda looking for an encapsulated solution, but I'll wrap it my self. Mar 23, 2015 at 15:42

1 Answer 1

0

You can try this JS code:

$('#<element id>').position().top.toString() + ',' + $('#<element id>').position().left.toString()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.