I'm currently having a problems with a window not coming up during tests in Internet Explorer. I'm using Selenium-RC 2.6.0, programming my tests in C# and launching them using NUnit.
All of my tests work in Firefox and Chrome, but in Internet Explorer 9 when selenium executes a click on a link (The link launches a new window using Javascript) no window comes up. The window comes up just fine in Firefox and Chrome.
Turn on Popup-blocker is off, Enable Protected Mode is off, Accept all Cookies is on. Windows Firewall is off. Can anyone think of anyth开发者_Python百科ing else that could be causing it? Or if this is a known bug? I have searched extensively both on SO and Google and haven't turned up any helpful results yet.
Edit: Added code for the element I am attempting to use
<a id="supervisor" class="topmenu" onclick="switchSupervisor();" href="javascript:void(0);">
<span style="font-size: 13px;">
<strong>.</strong>
Supervisor
</span>
</a>
Thank you for the helpful answers, ironically enough although none of the posted solutions worked my problem was solved through a microsoft update that solved what was apparently a bug or strange functionality in IE that was repaired in the latest update. I can now easily launch it with a click, or fire event.
IE with Selenium has an annoying bug where elements won't get clicked properly if the link element has any nested elements and no text.
For example:
<a id="clickme"><img src="something" /></a>
In IE, the following doesn't work:
driver.FindElement(By.Id("clickme")).Click();
The workaround is to click the lowest element in the DOM tree under the link element:
driver.FindElement(By.Id("clickme")).FindElement(By.TagName("img")).Click();
//or
driver.FindElement(By.CssSelector("#clickme img")).Click();
Try to use
Selenium.FireEvent(@"css=a#supervisor", "click")
精彩评论