Karate - UI Testing - When using Zalenium Safari and MSEDGE immediately error on driver/session call => no capabilities found

断了今生、忘了曾经 提交于 2021-01-28 18:38:37

问题


git project: https://github.com/jbart18/karate_testing

I'm trying to simplify having the main browsers (Chrome, Firefox, Edge & Safari) working via Zalenium. It seems the most simple approach and have been able to get chrome and firefox (gecko driver) running/working straight away.

The problem lies within Edge and Safari and the inability to submit capabilities in the session request.

I am running on Windows 10 professional and have been able to get tests working for: edge: through specifying the executable path and setting the webdriver session safari: running macos via VM and then specifying the executable path (a big hassle - though I will need to either debug safari issues or when needing xcode for mobile testing)

I am hoping to simplify e2e testing using zalenium. Please help. I followed "https://opensource.zalando.com/zalenium/#try-it" to get zalenium up and running

request: * configure driver = { type: 'safaridriver', start: false, webDriverUrl: 'http://localhost:4444/wd/hub'}

Error: "error": "unknown error", "message": "Error forwarding the new session cannot find : Capabilities {browserName: safari}",

However when I change the driver configuration statement"

* def session = { capabilities: { browserName: "safari" } }
* configure driver = { type: 'safaridriver', webDriverSession: '#(session)', start: false, showDriverLog: true, webDriverUrl: 'http://localhost:4444/wd/hub'}

Error:

HTTP ERROR 500

Problem accessing /wd/hub/session. Reason:

    Server Error

Caused by:

java.io.IOException: org.openqa.grid.common.exception.GridException: No capabilities found in request: {"capabilities":{"browserName":"safari"}}

I am unable to get either edge or safari via zalenium up and running. Your help is greatly appreciated.

Thanks

jbart18


回答1:


I am using Edge and Safari browsers of Saucelabs through Zalenium as below.

Microsoft Edge

{type : msedgedriver, webDriverSession : {capabilities : {browserName : MicrosoftEdge}, desiredCapabilities : {browserName : MicrosoftEdge}}, start : false, webDriverUrl : https://username:password@your_zalenium_host.com/wd/hub}

Safari

{type : safaridriver, webDriverSession : {capabilities : {browserName : safari}, desiredCapabilities : {browserName : safari}}, start : false, webDriverUrl : https://username:password@your_zalenium_host.com/wd/hub}



回答2:


Yes, the capabilities for Edge are hard to figure out. Meanwhile do take a look at this demo project for AWS Device Farm that may give you some ideas: https://github.com/ptrthomas/karate-devicefarm-demo



来源:https://stackoverflow.com/questions/64680998/karate-ui-testing-when-using-zalenium-safari-and-msedge-immediately-error-on

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!