I have a Selenium test which would fail when run as part of a Jenkins job on a node hosted in vSphere and administered through RDP. The test are run with IE11.
After some troubleshooting it turned out it succeeds if Remote Desktop is connected and focused but fails with an exception if Remote Desktop is disconnected or even minimized:
OneTimeSetUp: OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:56095/session/817b36df-a1b5-484e-b205-d4a0bac8002a/element/0cfa6678-2104-4bc6-bb71-e6d8eac507fb/value timed out after 60 seconds.
----> System.Net.WebException : The operation has timed out
The failing line:
textboxElement.SendKeys("foo").Perform();
As a workaround, I logged through vSphere Console instead of RDP and then even after closing vSphere the test didn't fail anymore. This is a workaround but I would have to be careful never to login through RDP and always to administer only through vSphere Console.
So my questions are:
- Is
SendKeys()
somehow incompatible with an RDP session and is it related to this winapi bug? - Is there an alternative to using
SendKeys()
in Selenium?