Before you Begin
- Open https://trainingbypackt.github.io/Beginning-Selenium/lesson_5/activity_5_B-1.html on Chrome and switch to source view.
- Use IntelliJ IDEA for the creation of a Selenium test.
Scenario
The web page we are performing the test on contains a button. By clicking on it, the values of the attributes of some elements are changed. To complete the automation process, we need to simulate the click of this button and then make our test wait before trying to find one of the elements whose attributes' values have changed.
Aim
To create a Selenium test that clicks on a button, and implement an explicit wait for the test.
Steps for Completion
- Review and analyze the DOM of the https://trainingbypackt.github.io/Beginning-Selenium/lesson_5/activity_5_B-1.html file, and see how elements are affected by the functionality of this file.
- Create a Selenium test that clicks on the available button by using the findElement method.
- Choose any of the elements whose attribute values are changed after clicking on the test button. Create an explicit wait for the chosen object.
- For each one of the instructions in step 3, check the contents of the title by using the if … else statement.
- Compile and run the test.
To refer to the detailed steps, go to the Solutions section at the end of this book on page no. 171.