1

I am using Selenium 2.35 and .Net4.5 with IE to validate a webpage. One series of tests fills a text box with SendKeys(), clicks the save button, switches to the logon dialog and closes it then repeats for 3 more text boxes. On my usual test machine this works great but running the same test on a different machine it breaks. After handling the logon dialog the IEDriverServer.exe CMD window is brought to focus and the subsequent test fails because the browser is no longer in focus.

Does anyone know why the IEDriverServer.exe CMD window gets focus and how I can prevent this?

4

1 回答 1

2

尝试使用 RequireWindowFocus 属性强制焦点

InternetExplorerOptions options = new InternetExplorerOptions();
options.RequireWindowFocus = true;
IWebDriver driver = new InternetExplorerDriver(options);
//navigate and sendkeys now
于 2013-09-24T01:06:18.810 回答