Reference no: EM133673714
Task: Decision table unit testing using Selenium Overview
In 4.1P you have constructed decision tables to test the login function in the provided
LoginForm.java file using JUnit. Decision tables are useful for testing functionalities in web applications. A common use case is creating decision table test cases for online login web pages using Selenium. Inspection of HTML elements to locate input elements could be tricky at the first place but once input elements are identified, selenium can be used to fill those fields with values and simulate submission of forms. You will need to harness your Selenium skills to write JUnit test cases to identify conditions how to assert on test cases to fail or pass. You should use the login page for this task. Compare unit testing functions in source code to unit testing functional interfaces using Selenium.
Instructions
For this task you will need to
Download task2_1P.zip Selenium Java project used earlier and unzip it in a common folder (say, java_projects) which you will be using to store all the weekly projects.
Import the project (as a maven project) in Eclipse IDE. Rename it by refactoring the project folder (Refactor > Rename) to task4_2C.
You need to create a decision table necessary for the login page https://www.bunnings.com.au/login and write JUnit test cases accordingly.
Use the code inspection feature of your browser to analyse the webpage how to locate the input elements of the login form using appropriate Selenium locator APIs.
You need to consider appropriate JUnit Assert functions, you may consider inspecting the web URL and how it changes after submitting a login page for cases of a successful login or failed login.
You can keep these 2 failed test cases from task2_1P original project folder that you imported for this project in step 1 and make these 2 tests pass by providing your name and id.
Run the test, take screenshot of test statistic.
Upload your folder to your GitHub account and take a screenshot.
Your Task
Your task is to:
Create test cases for the login page as mentioned above using decision tables.
Analyse the webpage's source to identify the login HTML elements and how to locate them using Selenium APIs.
Implement test cases using Selenium browser automation.
Make proper use of JUnit Assert module to validate how webpage URL changes can be used to decide if a test failed or succeeded.