0

I have gone through this article http://www.testautomationguru.com/selenium-webdriver-disposable-selenium-grid-infrastructure-setup-using-zalenium Integrating with Cloud Testing Platforms:

I have already added sauce username and access key in Environment variables. It docker, Zalenium works without Saucelabs but with saucelabs gives error: docker.exe: invalid reference format.

Without Saucelabs - works fine:

docker run --rm -ti --name zalenium -p 4444:4444 
-v /var/run/docker.sock:/var/run/docker.sock 
-v /tmp/videos:/home/seluser/videos --privileged dosel/zalenium start

With Saucelabs - gives formatting error:

docker run --rm -ti --name zalenium -p 4444:4444 -p 5555:5555 \ 
-e SAUCE_USERNAME 
-e SAUCE_ACCESS_KEY \ 
-v /tmp/videos:/home/seluser/videos \ 
-v /var/run/docker.sock:/var/run/docker.sock \ dosel/zalenium start --sauceLabsEnabled true

I am using Docker Toolbox on Windows 7

Already took reference of:

  1. docker: invalid reference format in shell script
  2. docker : invalid reference format
  3. Docker command returns "invalid reference format"
paul
  • 4,333
  • 16
  • 71
  • 144

1 Answers1

0

My mistake was - I was using back slash \. After removing it from command it worked. After removing it becomes

docker run --rm -ti --name zalenium -p 4444:4444 -p 5555:5555
-e SAUCE_USERNAME
-e SAUCE_ACCESS_KEY
-v /tmp/videos:/home/seluser/videos
-v /var/run/docker.sock:/var/run/docker.sock dosel/zalenium start --sauceLabsEnabled true

Take care of unnecessary space also.

paul
  • 4,333
  • 16
  • 71
  • 144
  • 1
    Exactly, the ```\``` is valid only in *nix operating systems. For Windows, you could use `^` or ` (backtick), I think it depends if you use PowerShell or the conventional terminal. – diemol Feb 04 '19 at 21:12