【问题标题】:Timeout when trying to run Mocha test with WebDriverJS尝试使用 WebDriverJS 运行 Mocha 测试时超时
【发布时间】:2014-05-06 18:34:02
【问题描述】:

我正在尝试在 Windows 机器上运行它并不断收到超时。我正在运行 Selenium,但它似乎无法完成与 URL 的连接。

var client = require('webdriverjs').remote({
    desiredCapabilities: {
        browserName: 'chrome'
    },
    logLevel: 'verbose'

});
var expect = require('chai').expect;


describe('Test example.com', function(){
    before(function(done) {
        client.init().url('http://example.com', done);
    });

    describe('Check homepage', function(){
     it('should see the correct title', function(done) {
        client.getTitle(function(err, title){
            expect(title).to.have.string('Example Domain');
            done();
        });
    });

    });

    after(function(done) {
        client.end();
        done();
    });
});

这是我收到的错误:

  1) Test example.com "before all" hook:
     Error: timeout of 10000ms exceeded
      at null.<anonymous> (C:\Users\sandy_000\AppData\Roaming\npm\node_modules\m
ocha\lib\runnable.js:139:19)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

【问题讨论】:

  • 您是否尝试将超时时间增加到例如999999999。你的测试工作正常,我已经测试过了。

标签: windows webdriver mocha.js selenium-chromedriver webdriver-io


【解决方案1】:

我找到了这个网站:http://aboutcode.net/2013/12/02/automating-chrome-on-windows-with-javascript-using-selenium-webdriverjs.html

我需要下载关联的可执行驱动程序并使用它启动 selenium,如下所示:

c:\myproject>java -jar selenium-server-standalone-2.35.0.jar -Dwebdriver.chrome.driver=chromedriver.exe

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-08
    • 2015-10-02
    • 2016-01-08
    • 1970-01-01
    • 2020-03-26
    • 2019-05-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多