Please check below code for Two Test Cases
@Test
public void homeTest() throws InterruptedException {
WebElement btnHome=driver.findElement(By.name("Home"));
String login_1 = btnHome.getText();
Assert.assertTrue(login_1.contains("Home"));
System.out.println(login_1);
btnHome.click();
Thread.sleep(1000);
}
@Test
public void secondTest() throws InterruptedException {
WebElement btnSecond=driver.findElement(By.name("Second"));
String login_2 = btnSecond.getText();
Assert.assertTrue(login_2.contains("Second"));
System.out.println(login_2);
btnSecond.click();
Thread.sleep(1000);
}
Thank you