In this previous post, my colleague discussed the benefits of using the Page Object Model Pattern to write your automated tests. In this video blog, I’ll show you some examples of how to write POM tests using the latest release of Selenified (3.0).
Because Selenified supports parallel test execution, it’s important to ensure tests have the resources required to execute concurrently. For this reason, my example creates a Thread Safe instance of our Google page object.
ThreadLocal google = new ThreadLocal<>();
By instantiating a ThreadLocal object in combination with the setupApp() method, we ensure that multiple tests can reuse the same elements as each thread creates its own local instance of the class variables.
Also, at 9:59 when describing my Google search box element, I stated that I created an “App” Object when it should have been an “Element” Object.
Hammid is a Software QA Engineer with a strong focus on automation and DevOps. He currently works with government agencies, helping to modernize their applications and practices while delivering quality software.