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.

sendKeys with multiple keys (CTRL+a) no more working

See original GitHub issue

Hi there!

Bug report

  • Node Version: 7.5.0
  • Protractor Version: 4.0.14
  • Browser(s): Chrome 56 on centos 7 (idem for Firefox)
  • Operating System and Version CentOS 7
  • Your protractor configuration file:
'use strict';

var testiCommons = require('../utilit/testiCommons.js');

exports.config = {
    framework: 'mocha',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['../../../*/tests/protractor/**/*.js'],
    baseUrl: 'http://localhost:3001',
    getPageTimeout: 30000,
    allScriptsTimeout: 30000,
    mochaOpts: {
        timeout: 30000, // ms,
        reporter: 'spec',
        slow: '2000', // a test is slow if it takes over 1 sec to accomplish
        delay: true
    },

    capabilities: {
        // If this is set to be true, specs will be sharded by file (i.e. all
        // files to be run by this set of capabilities will run in parallel).
        // Default is false.
        shardTestFiles: false,

        // Maximum number of browser instances that can run in parallel for this
        // set of capabilities. This is only needed if shardTestFiles is true.
        // Default is 1.
        maxInstances: 1,
        
        browserName: 'chrome',
//        browserName: 'firefox',
        
        'chromeOptions': {
            // Get rid of --ignore-certificate yellow warning
            args: ['--no-sandbox', '--test-type=browser'],
			// --start-maximized
			
            // Set download path and avoid prompting for download even though
            // this is already the default on Chrome but for completeness
            prefs: {
                'download': {
                    'prompt_for_download': false,
                    'default_directory': '/datas/temp',
                }
            }
        }
    },
    
    onPrepare: function() {
    },
    
    onComplete: function() {
        console.log('Into global onComplete test function');
        testiCommons.disconnectMongo();
    },
};
  • A relevant example test I try many combinaisons: $elt.sendKeys(webdriver.Key.CONTROL, 'a', webdriver.Key.NULL, keys); or
$elt.sendKeys(protractor.Key.chord(protractor.Key.CONTROL, 'a'));
$elt.sendKeys(keys);

or

browser.actions().keyDown(protractor.Key.CONTROL).sendKeys('a').perform();	  
$elt.sendKeys(keys);
browser.actions().keyUp(protractor.Key.CONTROL).perform();

Both configurations don’t work now (it was before) because CTRL+A (select text in field) is not selected.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

10reactions
jwooscommented, Mar 17, 2017

+1

Protractor: 4.0.14 Chrome Driver: 2.26

On Chrome 53 browser.actions.keyDown(protractor.Key.ALT).sendKeys('a').keyUp(protractor.Key.ALT).perform(); works perfectly fine. On Chrome 56, it does not work.

0reactions
StanislavKharchenkocommented, Sep 8, 2021

As far I know this works ok with w3c compliant selenium. You can’t use this with Protractor 7. Please ask @angular team regarding upgrades.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - SendKeys Ctrl-A not working - Stack Overflow
To specify that any combination of SHIFT , CTRL , and ALT should be held down while several other keys are pressed, enclose...
Read more >
Solved: Send multiple keys with one Send Keys option
I want to trigger the keyboard shortcut i.e Ctrl+Alt+Shift+1 through "Send Keys". I already tried {Control}({Alt}{Shift}{1}). But it's not ...
Read more >
How to Use Excel SendKeys Method in Macros - Contextures
This sends a key combination of Ctrl + Shift + F2 to Excel, instead of Shift + F2.
Read more >
How do you press two keys at the same time with Python ...
I can't get this to work on my end either. ... So any keyboard shortcut handlers in the browser process will not be...
Read more >
XType - Real User Keyboard Event Simulation, Sendkeys
The classic Type or Sendkeys command as used by UI.Vision RPA and any other Selenium IDE or browser automation tool does not simulate...
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