Selenium Tests, the Object Oriented Way

When you are writing Selenium tests to check for elements on your page, by taking the classic approach (checking for each element’s properties at a time), you might get to a large number of assert steps. This increases the lines of code your tests have, make the tests difficult to maintain and tricky to read.

Wouldn’t it be nice if the actual checking part of the test would be small, perhaps one line of code? With the approach I am going to present, you can do just that. Hence your tests will be small and clean. All you will need to do is model the pages/modules/items by using an Object Oriented approach.

Session Takeaways:

  • Writing Selenium tests for complex modules.
  • Not using one assert for each object to test.
  • Instead using objects, only one assert is needed.

Automation
Location: Rockbridge Date: September 28, 2017 Time: 3:45 pm - 4:45 pm Corina-Adina Pip