Question

I have a docker container running a rails app (let's call it container A) that needs to do some scraping with watir webdriver using firefox as backend.

I have firefox installed in another container (container B) and I want to be able to pass in container A something like:

Selenium::WebDriver::Firefox::Binary.path= $DOCKER_RUN_CONTAINER_A

So, each time watir launches firefox a new instance of CONTAINER_A launches a new firefox.

I know it's easy to make containers communicate using ports, but how about executables? And, by the way, does it look like a good design idea isolating firefox in a separate container?

Was it helpful?

Solution

Yes, this is easy to do. Just run an instance of Selenium Grid (which is a grid-node hybrid combo by default) , in the foreground on the docker server (on port 5555 or whatever). Then you can use Ruby with Selenium bindings (not WatiR) to drive the firefox browser on the remote box.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top