Creating a simple user acceptance test using Selenium and TestNG
In order to perform a user acceptance test, we won't be installing any tool or software on the testing server nor anything on the Jenkins server or the developer's machine.
Tools such as Selenium and TestNG will be defined as part of the pom.xml
file and everything will be done using Eclipse. The user acceptance test will be a part of the code, just like the unit test and the integration test.
Installing TestNG for Eclipse
To install TestNG, follow these steps:
From the Eclipse IDE menu, go to Help | Eclipse Marketplace.
In the window that opens, select the Search tab and look for
Testng
.Once you see TestNG for Eclipse, install it:
Modifying the index.jsp file
Our user acceptance test is going to be a simple example in which we will try to check the payslip page title. It should be PAY SLIP
.
Following are the steps to modify the index.jsp
file:
Open
index.jsp
from the following path:/payslip/src/main/webapp/
.Add the title
PAY SLIP
...