Hi I am trying to write a piece of selenium code for the login page of: https://www.phptravels.net/admin. I ab able to find the xpath for log in button but when the code is triggered I get this exception:
org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element ... is not clickable at point (640, 532). Other element would receive the click: ...
The code which I have written is:
public class pageObjectRepo {
WebDriver driver;
String mail="admin@phptravels.com";
String pass="demoadmin";
public pageObjectRepo(WebDriver driver)
{
this.driver=driver;
}
By email = By.xpath("(//*[@name='email'])[1]");
By pwd = By.xpath("(//*[@name='password'])[1]");
By loginbtn= By.xpath("//button[@type='submit']");
public void login() throws InterruptedException {
driver.findElement(email).sendKeys(mail);
Thread.sleep(1000);
driver.findElement(pwd).sendKeys(pass);
driver.manage().window().maximize();
Thread.sleep(5000);
driver.findElement(loginbtn).click();
}
login method is called in the actual test class.