package testselenium; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class demo { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "G:\\dev\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); String baseUrl = "http://localhost:8080/"; String username = "sonha"; String password = "30051999"; driver.get(baseUrl); WebElement usernamehBox = driver.findElement(By.name("username")); WebElement passwordhBox = driver.findElement(By.name("password")); usernamehBox.sendKeys(username); passwordhBox.sendKeys(password); driver.findElement(By.xpath("/html/body/form/div/table/tbody/tr[4]/td[2]/input")).click(); // driver.close(); } }