1

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

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
jbart18
  • 138
  • 7

2 Answers2

2

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}
  • thanks for your reply, @Prashant Patil - I was hoping for a solution which didnt require a paid subscription but it seems currently that isnt available. – jbart18 Nov 05 '20 at 02:04
0

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

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • Thanks for the quick reply Peter, though the AWS device farm example is utilizing chrome - is it possible to inject the required capabilities params into the configure driver statement to have safari/firefox working via zalenium? (p.S I've since attached a sample project - at top of the summary. – jbart18 Nov 04 '20 at 13:56
  • @jbart18 - yes but the problem is you need to know what exactly to pass. one way is to study what other ui frameworks do. here is a relevant thread: https://github.com/intuit/karate/issues/924 - also someone recently contributed edge support so I've pinged that person via slack to look over here: https://github.com/intuit/karate/pull/1302 – Peter Thomas Nov 04 '20 at 14:01
  • 1
    apologies Peter Thomas - after subsequent reading it's not an issue with Karate or the call but a limitation of the Zalenium grid. It runs/supports chrome/firefox tests through docker selenium. But... if you need a different browser, zalenium routes to a testing provider such as sauce labs or browser stack. Not ideal as they are all paid options. – jbart18 Nov 05 '20 at 02:01
  • @jbart18 many thanks for the update, this will help others who land on this page – Peter Thomas Nov 05 '20 at 02:39