Steps to reproduce
Selenium + Java + EDGE.
I can’t send special keys to EDGE (like f6 or f11). Because EDGE browser window haven’t focus when starts.
Step to reproduce:
- Get microsoftWebDriver instance in any way you want.
- Send any special keys to any input field or entire document:
-if you send any non-special keys, it’ll be ok:
driver.findElement(By.xpath(“…”)).sendKeys(“Bla bla bla”);
-but if you try to sent something like “f11” or "f6", it won’t work:
It will work only if you click by your mouse on browser window before send special key.
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “Zachariah L.”
Thank you for contacting us about this issue! Based on the information you have provided, I was unable to replicate the issue. Are you using the Windows Feature on Demand version of MicrosoftWebDriver? To install it, run the following command in an elevated command prompt: DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
Using the Windows Feature on Demand version of MicrosoftWebDriver, I ran the following Java code and was unable to reproduce the issue. I sent F5 to the page and was successfully able to refresh the page both at first load and after having sent keys to a text input.
Java Code: https://pastebin.com/xrd1f3J4
It’s funny, but the key " F5" really works. But keys “F6” or “F11” don’t work.
Using the code I linked earlier, I was unable to send the special keys F11 and F6 to Edge, however, Chrome did not respond to this either (Surprisingly sending F5 to Chrome this way did not work either). Have you tested against Chrome?
Confirm. In chrome even ‘f5’ doesn’t work.
But for chrome I have workaround:
I can require fullscreen by JS directly (something like this: document.documentElement.requestFullscreen() - equals send ‘f11’)
In edge It works only through eventListener.
PS: and edgeDriver doesn’t support the code below:
org.openqa.selenium.UnsupportedCommandException: Unknown command (WARNING: The server did not provide any stacktrace information)
Based on my attempted reproduction and another comment on this issue, It would appear that the issue with sending special keys appears to be an issue with Selenium rather than Edge. I would suggest that you open a ticket with their team and report the issue.
I am however, able to reproduce the issue with entering fullscreen on Microsoft Edge 44.17763.1.0 Microsoft EdgeHTML 18.17763 and not on Chrome.
- Microsoft Edge Team
Changed Assigned To to “edgedevtoolstri”
I can open new issue "edgeDriver doesn’t support fullscreen() method", if it’s better. How do you think?