Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Introduction

Image Removed 

The Selenium test environment will be set up independent from the project that is being tested and it will have its own GIT repository. The testing framework used is TestNG, and the Selenium tests will be built with Maven (ran with Maven SureFire). The properties file will be generated with Maven AntRun. 

...

  • Printing the xpath of an element after a failed test will help with locating elements that need to be fixed.
    Sample method for getting the xpath of an element:

    The method should go in the base page class. 
  • StaleElementException: A StaleElementException is thrown when the element you were interacting is destroyed then recreated. Elements in the DOM are often destroyed and recreated when a web page changes dynamically as users interact with it. When this happens the reference to the element in the DOM that you previously had becomes stale and you are no longer able to use this reference to interact with the element in the DOM. You will need to refresh your reference to find the element again. This can be done using a try catch block within a while loop. See example below.

The End

 Image Added

Happy testing! (smile)