1

We want to setup a Selenium Docker Hub Node Environment.I have successfully set it up using following:

docker run -d -p 4444:4444 --net inpronet --name selenium-hub selenium/hub:3.11.0-dysprosium

docker run -d --net inpronet -e HUB_HOST=selenium-hub -v /dev/shm:/dev/shm selenium/node-chrome:3.11

docker run -d --net inpronet -e HUB_HOST=selenium-hub -v /dev/shm:/dev/shm selenium/node-firefox:3.11.0-dysprosium

docker run -d -P -p 5900:5900 --net inpronet -e HUB_HOST=selenium-hub -v /dev/shm:/dev/shm selenium/node-chrome-debug:3.11.0-dysprosium

docker run -d -P -p 5901:5900 --net inpronet -e HUB_HOST=selenium-hub -v /dev/shm:/dev/shm selenium/node-firefox-debug:3.11.0-dysprosium

I have configured my C# based Selenium Tests as following:

IWebDriver driver;
DesiredCapabilities capability = DesiredCapabilities.Chrome();
capability.SetCapability("platformName", "ANY");

capability.SetCapability("version", "ANY");
driver = new RemoteWebDriver(new Uri("http://192.168.99.100:4444/wd/hub/"), capability, TimeSpan.FromSeconds(1600));

try {

         // NOTE: connection timeout of 600 seconds or more required for time to launch grid nodes if non are available.
          driver.Navigate().GoToUrl("URL1");
}

Now the challenge is that their are around 1500 tests that need to be executed on say 3-4 different URLs and also on Chrome and Firefox nodes simultaneously;

Example :

Chrome Node1 : Tests running on URL1 Chrome Node2 : Tests running on URL2 Firefox Node1 : Tests running on URL 3 ForeFox Node 2 : Test running on URL4

or :

Chrome Node1 : Tests running on URL1 Chrome Node2 : Tests running on URL2

Once the tests complete on Node 1 on Node 2 on chrome Firefox Node1 : Tests running on URL 1 ForeFox Node 2 : Test running on URL2;

We need this setup as we have the automation framework so created that we cannot run the tests parallel because it results in data creation deadlocks and the business decision as of now is not to modify the framework rather look at ways to run the tests sequentially on different URLs and different Nodes. Is it possible please?

How are the URLs mapped to Nodes i.e how is it decided that which URL will run on which chrome node(assuming there are 2-3 chrome nodes); How can we setup in Selenium Automation Framework(NUnit- C Sharp Based) to run the tests in sequence on 2-3 different URLs. We are aiming to reduce the no. of physical servers we have to execute our selenium tests on different URLs by implementing the DOcker Selenium Hub-Node concept.

I am stuck on this since a week and any advice would be very very helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.