Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium webdriver 使用Chimp/Webdriver启动其他浏览器时遇到困难_Selenium Webdriver_Webdriver Io_Chimp.js - Fatal编程技术网

Selenium webdriver 使用Chimp/Webdriver启动其他浏览器时遇到困难

Selenium webdriver 使用Chimp/Webdriver启动其他浏览器时遇到困难,selenium-webdriver,webdriver-io,chimp.js,Selenium Webdriver,Webdriver Io,Chimp.js,编辑-解决了我的问题,请参阅添加的详细信息。选择一个答案,因为它很有帮助并且切中要害,即使不是我的直接问题 问: 我跟在后面。我可以让一切按预期进行,但当我尝试使用单独的浏览器(比如firefox)时,我似乎只能从命令行启动它。我正在尝试查看如何/是否可以从代码开始… 我已经翻遍了,但似乎找不到相同功能的代码实现,我疯了吗 // I've tried to add the following code to the step_def.js , inside and outside of modu

编辑-解决了我的问题,请参阅添加的详细信息。选择一个答案,因为它很有帮助并且切中要害,即使不是我的直接问题

问:

我跟在后面。我可以让一切按预期进行,但当我尝试使用单独的浏览器(比如firefox)时,我似乎只能从命令行启动它。我正在尝试查看如何/是否可以从代码开始…

我已经翻遍了,但似乎找不到相同功能的代码实现,我疯了吗

// I've tried to add the following code to the step_def.js , inside and outside of module.exports = function()

var webdriverio = require('webdriverio');
var options = {
    desiredCapabilities: {
        browserName: 'firefox'
    }
};

webdriverio
    .remote(options)
    .init()
    .url('http://www.google.com')
    .title(function(err, res) {
        console.log('Title was: ' + res.value);
    })
    .end();


// but the output I get tells me something is wrong:

[chimp] Detected an unhandledRejection.
[chimp][hooks] Reason:
[chimp][hooks] RuntimeError
[chimp][hooks] Couldn't connect to selenium server
决议:

在“愚蠢的党”类别中:

我试着在不同的时间多次启动黑猩猩(Crontab作业)。但是,因为我用
$chimp--watch
来称呼它,挂钩和设置会变得一团糟(黑猩猩会用--watch来维持生命)
如果你想调用不同的浏览器,考虑使用不同的命令行ARG,比如黑猩猩浏览器=浏览器Firefox,而不是调整文件。使它更容易。

如果您试图同时使用两个浏览器,请尝试使用

这将在未来几周内合并