0

My team just set up a new jenkins server on an aws box we have. I'm setting up automation using zalenium. Everything was going well until this week when i started to receive a couple errors. Zalenium is set up on the same box jenkins is on. When jenkins tries to connects it can open a browser but doesnt load the page. When i try to run it from my laptop it gives me this error: too many redirects (Selenium::WebDriver::Error::WebDriverError). If i run zalenium on my laptop instead then i can run everything fine. I've tried pulling a fresh image of zalenium but it still doesnt work.

Here's the ruby code for calling the browser

    options = {}
    options[:options]={}
    # This is for local changes
    # options[:url] = 'http://localhost:4444/wd/hub'
    options[:url] = HUB_URL
    options[:options][:args] = %w[--test-type]
    options[:switches] = ["disable-infobars", "no-sandbox"]
    browser = Watir::Browser.new :chrome, options

Here's my docker commands

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

I've also tried changing the desiredContainers to 1. This was working last week but i can't figure out why it is failing now.

developer101
  • 63
  • 1
  • 6

1 Answers1

2

It is very unlikely that the problem lies in Zalenium or in your test, if the same setup works in your laptop but does not in Jenkins, I would start troubleshooting by finding out what changed in the Jenkins server in the last week.

You could also run a simple test in Jenkins using a different website, e.g. to google.com and do a simple search, with that you could check if the network config of the Jenkins box is correct, if Zalenium and your simple test are working, etc.

diemol
  • 613
  • 3
  • 10
  • No matter what url i try to go to it acts the same. If i actually go into the zalenium vnc i can manually go to the sites – developer101 May 10 '19 at 12:31