Watin: Launching IE with createInNewProcess==true times out IE and doesn't start test
I'm trying to develop and run 2 test projects (which use the same web application) at a time . When I run 2 different tests with 2 NUNIT-GUI instances a problem occures, because IE shares sessions and 1 test affects the other (logs out the user from the application). I found that Watin can create seperate processes of IE, constructor:
IE Constructor (String, Boolean)
Parameters: url The URL te open createInNewProcess if set to true the IE instance is created in a new process.
But when I set the createInNewProcess to true and launch a test just a blank IE window opens, no site address in entered and NUNIT times out with a communicate:
WatiN.Core.Exceptions.IENotFoundException : Could not find an IE window matching constraint: Timeout while waiting to attach to newly created instance of IE.. Search expired after '30' seconds.
What could be the problem? At the moment as a workaround I've started to v开发者_如何学JAVAirtualize a second system.
Watin uses your IE installed in the system, so even if you create newer instances they all shall share the same session which is due to the default behavior of Internet Explorer. You cant run multiple logins with Watin in parallel.
Also, WatiN.Core.Exceptions.IENotFoundException comes occasionally when a previous IE instance opened by Watin remains unclosed. Watin tries to search that in next run and throws this exception.
Make sure you go to task manager and close all instances of IE and then start your tests.
Also may mean that you are running this from a service. I kept getting this error message when running from a service but not when running from command line.
精彩评论