arfat jaya
arfat jaya

Reputation: 11

why i am getting this exception? Exception in thread "main" org.openqa.selenium.ElementClickInterceptedException:

i am trying to login into flipkart by providing login id and password.here is the code.but i am getting this exception. Exception in thread "main" org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element ... is not clickable at point (657, 27). Other element would receive the click: ...

public class Selanium {

    public static void main(String[] args) throws InterruptedException {



        WebDriver driver = new ChromeDriver();
        driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
            driver.get("https://www.flipkart.com/");


    driver.findElement(By.className("_3Ep39l")).click();



    Actions actions = new Actions(driver);
    actions.moveToElement(driver.findElement(By.xpath("//input[@class='_2zrpKA _1dBPDZ']")));
    Thread.sleep(1000);
    actions.click();
    actions.sendKeys("[email protected]");
    Thread.sleep(1000);
    actions.build().perform();
    actions.moveToElement(driver.findElement(By.className("_2zrpKA _3v41xv _1dBPDZ")));
    Thread.sleep(1000);
    actions.click();
    actions.sendKeys("sfghghyy56cgc@");
    Thread.sleep(1000);
    actions.build().perform();
    actions.moveToElement(driver.findElement(By.xpath("//button[@class='_2AkmmA _1LctnI 
 _7UHT_c']")));
    Thread.sleep(1000);
    actions.click();


    }

}

Upvotes: 0

Views: 249

Answers (1)

mkhurmi
mkhurmi

Reputation: 816

Trying using JavascriptExecutor:

//Creating the JavascriptExecutor interface object by Type casting      
    JavascriptExecutor js = (JavascriptExecutor)driver; 


 //Perform Click on WebElement using JavascriptExecutor     
        js.executeScript("arguments[0].click();", webElement);

Note: Please add below import in your code.

import org.openqa.selenium.JavascriptExecutor;

Upvotes: 1

Related Questions