SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

[IEDriver] SendKeys not working properly when using RequireWindowFocus and input that need AltGr #7108

Open lukeis opened 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 7108

What steps will reproduce the problem?
1.Have nuget reference to WebDriver 2.40
2.Simple test that hits https://www.google.fr/
3.Try to send the following input "#{[|]}€@"

There is the sample I made,

[TestMethod]
        public void TestMethod1()
        {
            var input = "#{[|]}€@";
            var requireWindowFocus = true;

            var internetExplorerService = InternetExplorerDriverService.CreateDefaultService(@"C:\Selenium");
            internetExplorerService.LogFile = string.Format(@"C:\Selenium\RequireWindowFocus_{0}.log",
requireWindowFocus);
            internetExplorerService.LoggingLevel = InternetExplorerDriverLogLevel.Trace;
            var internetExplorerOptions = new InternetExplorerOptions {RequireWindowFocus
= requireWindowFocus};

            using (var webDriver = new InternetExplorerDriver(internetExplorerService,
internetExplorerOptions))
            {
                webDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(2));

                webDriver.Url = "https://www.google.fr/";
                webDriver.FindElement(By.Name("q")).SendKeys(input);

                Thread.Sleep(TimeSpan.FromSeconds(3));

                Assert.AreEqual(input, webDriver.FindElement(By.Name("q")).GetAttribute("value"));
            }
        }

What is the expected output? What do you see instead?
Expected : #{[|]}€@, Actual : "'(-)=eà

It seems that InputManager::AddKeyboardInput has some trouble with AltGr.

Selenium version: C# binding 2.40 / IEDriverServer 2.40
OS: Windows 7 Pro / Window Server 2008R2
Browser: Internet Explorer
Browser version: 11 / 8
Locale: Fr
Keyboard mapping: AZERTY

Reported by ber.fabien on 2014-03-19 22:49:59


lukeis commented 8 years ago

Reported by luke.semerau on 2014-03-23 21:06:44

lukeis commented 8 years ago
i can reproduce this issue by sending a backslash with german keyboard layout and require_window_focus
true with 2.39. result is a "ß".

without window focus it works

maybe similar to http://code.google.com/p/selenium/issues/detail?id=6540

Reported by padder784 on 2014-05-15 14:23:49

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 17:46:33