Selenium webdriver Selenium在IE 11中单击鼠标右键
我正在自动化一个web应用程序,并面临一些困难。右键单击在IE中不起作用,但在Chrome中起作用Selenium webdriver Selenium在IE 11中单击鼠标右键,selenium-webdriver,Selenium Webdriver,我正在自动化一个web应用程序,并面临一些困难。右键单击在IE中不起作用,但在Chrome中起作用 WebElement elem = driver.findElement(By.id(conf.getPropertyValues("RIGHTCLICKTOMODIFY"))); Actions action= new Actions(driver); action.contextClick(elem).sendKeys(Keys.ARROW_DOWN).sendKeys(Key
WebElement elem = driver.findElement(By.id(conf.getPropertyValues("RIGHTCLICKTOMODIFY")));
Actions action= new Actions(driver);
action.contextClick(elem).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();
Thread.sleep(3000);
WebElement button = driver.findElement(By.id(conf.getPropertyValues("RIGHTCLICK_MODIFY_LINK")));
显然,这是一家尚未关闭的公司。您可以尝试两种可能的解决方法来解决此问题:
- 通过
模拟脚本驱动程序执行脚本。executeScript(/*Do something*/)
- 使用
修改Internet Explorer的功能,因为浏览器可能不支持一个或多个setCapability(“nativeEvents”,false)
功能。了解更多关于该主题的见解webdriver
- 通过
模拟脚本驱动程序执行脚本。executeScript(/*Do something*/)
- 使用
修改Internet Explorer的功能,因为浏览器可能不支持一个或多个setCapability(“nativeEvents”,false)
功能。了解更多关于该主题的见解webdriver
我希望我的回答能对您有所帮助。您为什么在
ContextClick
方法中使用SendKeys
?为什么在ContextClick
方法中使用SendKeys
?