question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

keyDown() does not work with Internet Explorer Driver

See original GitHub issue

I have tried to do it in different ways, but what works on Chrome (version 46.0.2490.86 m) and Firefox (version 42.0) won’t work with IE 9. Neither

browser.actions()
            .sendKeys(protractor.Key.chord(protractor.Key.CONTROL, '1'))
            .perform()

nor

browser.actions()
            .keyDown(protractor.Key.CONTROL)
            .sendKeys('1')
            .keyUp(protractor.Key.CONTROL)
            .perform();

work. I use protractor to send my tests to the selenium standalone server (which is on a VM which runs win7). Please tell me in case I overlooked something or if there is a workaround for this issue.

Full test:

describe('keyDown', function () {
    browser.ignoreSynchronization = true;
    browser.get('http://ci.seleniumhq.org:2310/common/keyboard_shortcut.html');

    it('should work with IE9', function () {
        browser.actions()
            .sendKeys(protractor.Key.chord(protractor.Key.CONTROL, '1'))
            .perform()

        expect(element(by.tagName('body')).getAttribute('style')).toContain('background: red');
    });
});

Thank you in advance, Miro

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jimevanscommented, Dec 7, 2015

What happens if you start your IE session with setting the requireWindowFocus capability to true?

0reactions
pavoltravnikcommented, May 24, 2018

requireWindowFocus capability to true helped

Read more comments on GitHub >

github_iconTop Results From Across the Web

keyDown() does not work with Internet Explorer Driver #1351
I have tried to do it in different ways, but what works on Chrome (version 46.0.2490.86 m) and Firefox (version 42.0) won't work...
Read more >
WebDriver - Key commands in Internet Explorer - Stack Overflow
I've had to resort to using a Robot to do it for Internet Explorer: import java.awt.Robot ... Robot robot; try { robot =...
Read more >
Keypress event not working in IE - MSDN - Microsoft
Hi kumar402,. Keypress event is not working in IE. in my angular application. The keypress() method and keydown() method should be supported in ......
Read more >
Re: keyDown(keys.CONTROL) not working at all
By using the type "WebDriver" in the line I marked in the sample, you declared a local variable named "driver" in your setUp()...
Read more >
Tutorial On Handling Keyboard Actions In Selenium ...
Implementing that change would need proper usage of Keyboard Actions in Selenium WebDriver. This will also depend on whether the browser on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found