问题描述
我有一套使用夜视仪内置的本地驱动程序进行的测试.效果很好.
我正在使用Perfecto Mobile和selenium-webdriver运行基本测试.它适用于此示例.( https://community.perfectomobile.com/series/20208/帖子/1002862 )
我正在尝试将我的夜视测试套件连接到perfecto,但是无法启动硒.如果这是硒服务器的URL.
var url ="https://mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub";
我尝试了几种方法在夜视仪配置下进行设置,但无法使其正常工作.
"selenium":{"start_process":是的,主机":"mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub"}
夜视仪中是否有与 usingServer 等效的产品?我在文档中什么都没有看到.
driver =新的webdriver.Builder().usingServer(url).withCapabilities(capabilities).建造();
结果证明这是所需的设置.
"test_settings":{"perfecto":{"use_ssl":是的,"default_path_prefix":"/nexperience/perfectomobile/wd/hub","selenium_port":443,"selenium_host":"mobilecloud.perfectomobile.com","desiredCapabilities":{"browserName":"xxx","deviceName":"xxx",用户":"[email protected]",密码":"xxx","platformName":"xxx"}}}
在撰写问题时无法使用的重要部分: default_path_prefix 无法自定义.
/wd/hub 是默认前缀.但是我确实需要/nexperience/perfectomobile/wd/hub .
两天后,引入了此提交.它在0.9.5版本中可用.
https://github.com/nightwatchjs/nightwatch/commit/aa24c2c2334c42388318498f654d8fe2957967d1 /p>
I have a suite of tests using local drivers built with nightwatch. Works well.
I am running a basic test using Perfecto Mobile and selenium-webdriver. It works with this example.(https://community.perfectomobile.com/series/20208/posts/1002862)
I am trying to connect my suite of nightwatch test to perfecto, but can't start selenium. If this is the url of the selenium server.
var url = "https://mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub";
I tried a few ways to set it up under nightwatch config, but can't make it work.
"selenium" : {
"start_process" : true,
"host" : "mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub"
}
Is there an equivalent to usingServer in nightwatch? I haven't seen anything in the docs.
driver = new webdriver.Builder().
usingServer(url).
withCapabilities(capabilities).
build();
Turns out this was the setup needed.
"test_settings" : {
"perfecto" : {
"use_ssl": true,
"default_path_prefix": "/nexperience/perfectomobile/wd/hub",
"selenium_port" : 443,
"selenium_host" : "mobilecloud.perfectomobile.com",
"desiredCapabilities": {
"browserName": "xxx",
"deviceName": "xxx",
"user": "[email protected]",
"password": "xxx",
"platformName": "xxx"
}
}
}
The important part that didn't work at the time of writing the question: the default_path_prefix was not customizable.
/wd/hub was the default prefix. But I really needed /nexperience/perfectomobile/wd/hub.
Two days later, this commit was introduced. It is available in 0.9.5 release.
https://github.com/nightwatchjs/nightwatch/commit/aa24c2c2334c42388318498f654d8fe2957967d1
这篇关于nightwatch.js可以使用Selenium-Webdriver中的usingServer吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!