protractor icon indicating copy to clipboard operation
protractor copied to clipboard

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

Open jmcollin78 opened this issue 8 years ago • 5 comments

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.

jmcollin78 avatar Feb 04 '17 07:02 jmcollin78

Having a similar issue: Protractor 5.1.0 Node 6.9.1 Chrome driver 2.27 Chrome 56.0

element(by.css('input')).sendKeys(arg1).then(function() { browser.actions().sendKeys(protractor.Key.ENTER).perform().then(callback); });

browser.driver.actions() .mouseDown(element($(cssSelector)).getWebElement()) .mouseMove({x: 0, y: amount}) // try different value of x .mouseUp() .perform();

Both no longer work, they send back weird error messages with no stack trace like [ null ] and [ null, null, null, null ]

rossjohnson90 avatar Feb 06 '17 11:02 rossjohnson90

+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.

jwoos avatar Mar 17 '17 16:03 jwoos

Same issue here, any updates?

Protractor: 5.4.2 Chrome Driver: 2.41

nohanna avatar Jul 09 '19 13:07 nohanna

Any update on this issue?

vaibhavso avatar Sep 08 '21 03:09 vaibhavso

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.

StanislavKharchenko avatar Sep 08 '21 07:09 StanislavKharchenko