O'Reilly logo

Mobile Test Automation with Appium by Nishant Verma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refactor-2

We will start this refactoring by creating a new package under the java folder of the solution called pages, illustrated here:

  1. Right-click on the pages, select New > Java Class, and enter the name LandingPage
  2. Copy the preceding code snippet of LandingPage and paste it
  3. We also need to implement wait for the visibility of elements to remove any flakiness in the test

We learned about test synchronization in the last chapter, and we also learned about the importance of a proper wait strategy in the test. So, instead of having each page class create its own implementation of WebDriverWait, we can extract it to a base page, which can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required