mercredi 11 mars 2020

Need to select a checkbox in WebDriver

I need to tick the Add GPUs check box. WebSite https://cloud.google.com/products/calculator There is a code

WebElement checkAddGRU = new WebDriverWait(driver, 20)
            .until(ExpectedConditions.
                    presenceOfElementLocated(By.xpath("//md-input-container/md-checkbox/div[contains(text(),'Add GPUs')]")));
    WebElement numberOfGPU = new WebDriverWait(driver, 10)
            .until(ExpectedConditions.elementToBeClickable(By.xpath("//md-select[@placeholder='Number of GPUs']")));
    while (!numberOfGPU.isDisplayed()) {
        checkAddGRU.click();
    }

But it don't work. The checkbox leasted empty.

Aucun commentaire:

Enregistrer un commentaire