我在网页上有一个按钮,当我通过IE运行时,Webdriver不会点击 - 我尝试过以下的解决方法,但没有运气 -
点击通过Javascript:
((JavascriptExecutor) driver).executeScript("$(arguments[0]).click()", webElement)
Run Code Online (Sandbox Code Playgroud)
使用SendKeys:
webElement.SendKeys(keys.Enter)
Run Code Online (Sandbox Code Playgroud)
使用Action Builder
Actions test = new Actions(driver);
test.moveToElement(webElement);
test.clickAndHold();
test.release();
test.build();
test.perform();
Run Code Online (Sandbox Code Playgroud)
确保窗口是活动窗口,然后单击父对象,然后单击对象本身
问题是,它们都不起作用.我已经检查过Firefox和Chrome,脚本运行正常.我已经确认在使用IE时会找到该元素.我还可以尝试其他解决方法吗?