简体   繁体   中英

Not able to click on checkBox through selenium webdriver.getting error element not visible

在此处输入图片说明

I'm adding picture of My DOM and where i want to click(circled). I have used

driver.findElement(By.id("itsId")).click()

and javascript for clicking on it but it is giving error element not visible.I can see Unselectable-ON in htlm is it have something to do with clicking? I'm not able to click on any element present on page having unselectale ON.

Try this:

import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("chkObjectAccountsCheckboxAll")));
driver.findElement(By.id("chkObjectAccountsCheckboxAll")).click();

this will wait at least 10 seconds until element will be clickable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM