【问题标题】:How to run testcafe tests on mobile chrome using selenium hub如何使用 selenium hub 在移动 chrome 上运行 testcafe 测试
【发布时间】: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


    【解决方案1】:

    此包与我们的产品无关。但我看到你已经联系了它的作者:https://github.com/alexschwantes/testcafe-browser-provider-selenium/issues/14。因此,据我了解,它不提供对 Android 的支持。

    【讨论】:

    • 有没有其他方法可以连接testcafe和docker android?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-23
    • 2016-01-14
    • 1970-01-01
    • 2018-09-07
    • 2014-12-27
    相关资源
    最近更新 更多