java - action.keyDown(Keys.CONTROL).sendKeys("j").keyUp(Keys.CONTROL).build().perform(); does not work if the test browser is not under focus of the OS -
i using java , selenium write tests chrome. need open download page @ 1 point used code below:
action.keydown(keys.control).sendkeys("j").keyup(keys.control).build().perform();
and works long os focus on test browser, mean if run test , go , click somewhere else (for example if start coding in ide while test running) code wont work.
how can bring focus test browser or other way code works , download window open on test browser?
the interesting point works for: action.keydown(keys.control).sendkeys("a").keyup(keys.control).build().perform();
if it's not focused!!!
if goal clear downloads, , cannot start chromedriver fresh state, can try following:
driver.get("chrome://downloads/"); ((javascriptexecutor) driver).executescript("chrome.send('clearall');");
Comments
Post a Comment