【发布时间】:2020-06-07 13:57:28
【问题描述】:
我正在尝试在 selenium hub 上运行 testcafe。
我的命令:
docker network create network
docker run -d -p 4444:4444 --net network --name selenium-hub selenium/hub
docker run -d -e HUB_PORT_4444_TCP_ADDR=selenium-hub -e HUB_PORT_4444_TCP_PORT=4444 --shm-size=2gb -v /dev/shm:/dev/shm --network network --name chrome selenium/node-chrome
docker run -d -e HUB_PORT_4444_TCP_ADDR=selenium-hub -e HUB_PORT_4444_TCP_PORT=4444 -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --shm-size=2gb -v /dev/shm:/dev/shm -e CONNECT_TO_GRID=true -e APPIUM=true --network network --name chrome-mobile -e SELENIUM_HOST=selenium-hub -e MOBILE_WEB_TEST=true -e APPIUM_PORT=4723 butomo1989/docker-android-arm-7.1.1
我正在使用这个包连接到集线器: testcafe-browser-provider-selenium - https://www.npmjs.com/package/testcafe-browser-provider-selenium
我可以在http://localhost:4444/grid/console 看到这两种配置
我可以使用以下方法在 linux chrome 上运行测试:
testcafe selenium:chrome:Linux my_first_test.js
但我无法在 android chrome 上运行测试:
[my_first_project (master)]$ testcafe selenium:chrome:Android my_first_test.js
Using locally installed version of TestCafe.
The "src", "browsers" options from the configuration file will be ignored.
ERROR Was unable to open the browser "selenium:chrome:Android" due to error.
SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): 'deviceName' can't be blank
at Object.checkLegacyResponse (/Users/abc/node_modules/selenium-webdriver/lib/error.js:585:15)
请帮我解决这个问题。 我的最终目标是能够在 CI 中的移动浏览器上运行 chrome,并且不想使用像 browserstack 这样的云浏览器。如果 android 图像不起作用,我愿意接受其他想法。
【问题讨论】:
标签: testing automation automated-tests e2e-testing testcafe