Browser refresh by Ctrl+F5 in WebDriver using Java

帅比萌擦擦* 提交于 2020-02-28 04:23:31

问题


I have refreshed the browser in WebDriver using java as below code:

driver.navigate().refresh();

How can I do that by pressing Ctrl+F5 in WebDriver using Java?


回答1:


I think you can use the WebDriver and Actions instance as below:

Actions actionObject = new Actions(driver);
actionObject.keyDown(Keys.CONTROL).sendKeys(Keys.F5).keyUp(Keys.CONTROL).perform‌​();


来源:https://stackoverflow.com/questions/12299960/browser-refresh-by-ctrlf5-in-webdriver-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!