When I run this code inside mstest testmethod using c#…
IWebDriver iWebDriver = new InternetExplorerDriver();
WebDriverBackedSelenium webDriverBackedSelenium = new WebDriverBackedSelenium(iWebDriver, "http://localhost:53157");
webDriverBackedSelenium.Start();
webDriverBackedSelenium.WaitForCondition("selenium.browserbot.getUserWindow().$.active == 0", "5000");
I get a Javascript error (UnexpectedJavaScriptError) yet I have seen example after example that this is the way to go.
As an additional peice of information I have tested that jquery-1.7.1 is loaded and usable. I have even tested within the webpage without selenium just using an inline script to see if $.active would work and it does.
Can anyone tell what I’m doing wrong here? Any guess would be welcome.
When you’re using WebDriverBackedSelenium, you have a lot more latitude with the types of script you can execute. Additionally, you don’t need to use “selenium.browserbot”, and indeed, the browserbot object may not even be loaded by WebDriverBackedSelenium. If you try the following, it should work: