我无法在Selenium webdriver上单击" not able to click Button(element) .
HTML标记
<button class="btn-secondary ml-05" test-id="MODULE1A_BUTTON">Without Optimisation</button>
<<p>Java代码/strong>driver.findElement(By.xpath("//Button[@test-id ='MODULE1A_BUTTON' ]")).click();
尝试使用js执行器点击它,如下所示:
WebElement element = driver.findElement(By.xpath("//Button[@test-id ='MODULE1A_BUTTON' ]"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);