org.openqa.selenium.ElementClickInterceptedException:元素单击被拦截:

时间:2019-07-24 22:35:19

标签: radio-button selenium-chromedriver

我正在尝试访问并单击单选按钮,如果尚未单击,它看起来像这样:

<label for="Company4"> </label> ::after

如果单击,它看起来像这样:

<label for="Company4"> </label> ::before ::after

我尝试了JavascriptExecutor和操作

   WebElement companyRadio = driver.findElement(By.xpath("//*[@id=\"roleService\"]/table/tbody/tr[2]/td/div[2]/div[1]/label"));
((JavascriptExecutor)driver).executeScript("window.scrollTo(0,"+companyRadio.getLocation().x+")");
    companyRadio.click();

0 个答案:

没有答案