Form Authentication is basic page to login a site. So we are using selenium to create a test automated for this site.
Test Case description
Steps:
- Open browser
- Navigate to https://the-internet.herokuapp.com/login
- Fill in username with
tomsmith
- Fill in the password with
SuperSecretPassword!
- Click on Login button
- And the home page is appear
Writing code
We using two dependencies
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<scope>test</scope>
</dependency>
Tạo Test class