Currently Browsing

Posts Tagged ‘ Java Selenium Element ’

Java Selenium Element Locations

Sometimes you need to test are the elements in place regarding to each other. Finding inner-child elements, to check do they overlap partially or totally each other.
Are they visible and dimensions regarding the display and so forth. It depends on what do you need, there are wide varieties for testing, from which I will cover the most used cases.

Is this quick tutorial I will cover three basic tests :

  1. Is one element inside the other
  2. Do elements have overlap of borders
  3. Are two elements apart from each others (outside one another with no overlap of borders)

Let see some code, I shall use Java program language with Selenium 2 Webdriver and testNG for unit testing.