Protractor: sendKeys 与多个键 (CTRL+a) 不再工作

创建于 2017-02-04  ·  3评论  ·  资料来源: angular/protractor

你好呀!

错误报告

  • 节点版本: 7.5.0
  • 量角器版本: 4.0.14
  • 浏览器: Chrome 56 on centos 7 (idem for Firefox)
  • 操作系统和版本CentOS 7
  • 你的量角器配置文件:
'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();
    },
};
  • 相关示例测试
    我尝试了很多组合:
    $elt.sendKeys(webdriver.Key.CONTROL, 'a', webdriver.Key.NULL, keys);
    要么
$elt.sendKeys(protractor.Key.chord(protractor.Key.CONTROL, 'a'));
$elt.sendKeys(keys);

要么

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

两种配置现在都不起作用(以前是这样),因为没有选择 CTRL+A(在字段中选择文本)。

最有用的评论

+1

量角器:4.0.14
铬驱动程序:2.26

在 Chrome 53 上browser.actions.keyDown(protractor.Key.ALT).sendKeys('a').keyUp(protractor.Key.ALT).perform();工作得很好。
在 Chrome 56 上,它不起作用。

所有3条评论

有类似的问题:
量角器 5.1.0
节点 6.9.1
铬驱动程序 2.27
铬 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();

两者都不再起作用,它们发回没有堆栈跟踪的奇怪错误消息,例如 [ null ] 和 [ null, null, null, null ]

+1

量角器:4.0.14
铬驱动程序:2.26

在 Chrome 53 上browser.actions.keyDown(protractor.Key.ALT).sendKeys('a').keyUp(protractor.Key.ALT).perform();工作得很好。
在 Chrome 56 上,它不起作用。

同样的问题,有更新吗?

量角器:5.4.2
铬驱动程序:2.41

此页面是否有帮助?
0 / 5 - 0 等级