我的 Selenium 配置有问题。我正在尝试在 iOS 和 Android 上自动化 Selenium 测试。
iOS 测试与 iOS 驱动程序独立运行正常。 Android 测试也能独立正确运行。
但是当我想运行 iOS 和 Android 时,我遇到了问题!
对于我的 Android 测试,我运行了这个命令,一切都很好:
java -jar selendroid-standalone-0.17.0-with-dependencies.jar
但是当我想集成 iOS 测试时,我按照本指南更改了此命令的端口:http://selendroid.io/scale.html
但是当我添加 -port 5555 时,我的 Android 测试失败了。出现此错误:
org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities [{automationName=selendroid, platform=ANDROID, platformName=android, browserName=android, serial=VM-IP}]
我使用以下命令启动配置:
java -cp ios-grid-plugin-0.6.6-SNAPSHOT-4.jar:selenium-server-standalone-2.52.0.jar:selendroid-grid-plugin-0.17.0.jar org.openqa.grid.selenium.GridLauncher -role hub http://192.168.2.33:4444/wd/hub
我做错了什么吗?
感谢帮助
最佳答案
Error forwarding the new session cannot find
这是网格告诉您您正在尝试创建具有网格不知道的功能的新浏览器 session 的方式。
启动 Selendroid 服务器后,您是否按照 this 中所述运行了 CURL 命令?页面
curl -H "Content-Type: application/json" -X POST --data @selendroid-nodes-config.json http://localhost:4444/grid/register
这样做现在会强制 selendroid 服务器将自己注册到在本地主机中运行的网格并监听“4444”,并通知网格它可以为 android 测试提供服务。
如果没有这个,我认为您无法在网格模式下运行 Selendroid 测试。
关于java - Selendroid "Error forwarding the new session cannot find : Capabilities",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35849149/