当我尝试单击 Firefox
中的一个元素时出现以下错误浏览器。
Element is not clickable at point (320.2166748046875, 55). Other element would receive the click:
<a class="navbar-brand" href="#"></a>
Selenium 代码
WebElement p = driver_new.findElement(By.xpath("html/body/div[2]/div/form/fieldset[2]/div[3]/div/div[2]/a[1]/div/div/div[2]"));
p.click();
请帮忙解决。
最佳答案
如果您尝试了所有方法但没有成功,您应该尝试使用 javascriptExecutor
来执行 click
,如下所示:-
import org.openqa.selenium.JavascriptExecutor;
WebElement bp = driver_new.findElement(By.xpath("html/body/div[2]/div/form/fieldset[2]/div[3]/div/div[2]/a[1]/div/div/div[2]"));
((JavascriptExecutor)driver_new).executeScript("arguments[0].click()", bp);
关于java - 运行 firefox 时出现 selenium 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38889633/