I have a coded ui test project that I created from scratch (no recording, its for a massive MVC site so I needed it to be really organized) and it's running perfectly when I run it from the VS 2012 Test Explorer. When i try running it from an external console application, however, the instance of BrowserWindow is acting funky(and not in a good way).
My test while trying to work through this is just having these lines at the beginning of the test method:
BrowserWindow browserWindow = BrowserWindow.Launch(new Uri("whateverurl.com"));
Mouse.click(browerWindow);
When i run it from the console application the click throws an error about the control being blocked.
If i try running anything like:
browserWindow.ExecuteScript("return true;");
I get a UITestException "Specified cast is not valid" (this also works fine from the Test Explorer).
I have made sure that playback is initialized in the console application and that the instances of Browserwindow look the same in the debugger from running it in both the console app and test explorer.
Anyone know what might be causing this?