vendredi 26 août 2016

Other element would receive the click error

How do you click the cart icon if the error says element is not clickable? I already tried it using inspect element but to no avail. I've been doing this for hour and I still don't get how to click the cart icon.

driver.get("http://ift.tt/2bUsBTY");
        driver.findElement(By.cssSelector(".hover-green")).click();
        driver.findElement(By.cssSelector("#ember781")).sendKeys("deumdummy@yahoo.com");
        driver.findElement(By.cssSelector("#ember783")).sendKeys("password");
        driver.findElement(By.cssSelector("button.btn.green.block")).click();
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        driver.findElement(By.xpath("//span[contains(@style,'background-image: url(http://ift.tt/2ceCXkJ)')]")).click();

        WebElement element = driver.findElement(By.cssSelector(".btn.green.medium"));
        Actions actions = new Actions(driver);
        actions.moveToElement(element).click().perform();

        driver.findElement(By.xpath("//img[@alt='Acana Duck And Bartlett Pear Singles Formula']")).click();
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        driver.findElement(By.cssSelector("a.btn.green.huge.block")).click();
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


        driver.findElement(By.cssSelector(".ember-view.cart-icon")).click();
        WebDriverWait wait = new WebDriverWait(driver,30);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(".btn.green.jumbo]"))); 

Aucun commentaire:

Enregistrer un commentaire