FAQ
Has anyone ever succeeded clicking a label while debugging (i.e. IE is not
focused) on an intranet or "compatibility view"-enabled site? I've tried
every combination ofEnableNativeEvents/RequireWindowFocus/
EnablePersistentHover I could think of (withRequireWindowFocus just hanging
the browser), bar sending a js snippet to click nothing works.

Here Process.Start simulates loosing focus, e.g. when hitting a breakpoint.

Windows 7 x64, IE 10 x86, WebDriver 2.33.0.0, IEDriverServer Win32 2.33.0

[Test]public void CompatibilityViewLabel(){
     var options = new InternetExplorerOptions
     {
         EnableNativeEvents = false,
         //RequireWindowFocus = true,
         //EnablePersistentHover = true,
     };

     var driver = new InternetExplorerDriver(options);
     driver.Navigate().GoToUrl("http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_label");

     var filter = (byte[])Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData").GetValue("UserFilter");
     if (filter == null || !Encoding.Unicode.GetString(filter).Contains("w3schools.com"))
         Assert.Fail("Click Compatibility View icon and retest.");

     driver.SwitchTo().Frame("iframeResult");
     var input = driver.FindElement(By.Id("male"));
     var label = driver.FindElement(By.CssSelector("label[for='male']"));

     Process.Start("cmd");

     label.Click();
     //driver.ExecuteScript("arguments[0].click()", label);

     Assert.IsTrue(input.Selected);}

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/77e57016-4972-4e4d-8e0f-b545ae69cc2d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedJul 14, '13 at 5:35a
activeJul 23, '13 at 10:36a
posts2
users1
websiteseleniumhq.org

1 user in discussion

Ilya Kozhevnikov: 2 posts

People

Translate

site design / logo © 2023 Grokbase