Executing Protractor Test Using Selenium Grid


Executing Protractor Test Using Selenium Grid

In this session, we will look into how we can execute our Protractor Test Case in parallel across different browsers using the selenium grid.

Before moving further let's understand the advantage of the Selenium grid.

รผ  It allows us running multiple tests across different browsers, Operating systems, and machines.
รผ  It helps us in parallel execution of our test.
รผ  Since the test case is running in parallel across different browsers and machine it will help us in speeding up our test execution.




To Setup Grid in our machine we need to follow below steps:

1)  Download Selenium Server standalone Jar from this link. In this blog, I am using 3.12.0 version.


2)  Place this Jar file in some folder on your local machine.

3)  Now we need to navigate to the path where this selenium server standalone file is located and start our Hub machine by using the below command. (Hub is the master machine will instruct our node machine to execute our test)

       java -jar selenium-server-standalone-3.12.0.jar -role hub



4)    Then we need to place the exact same version of this JAR on our node or remote machine where we want to execute our test and execute the below command.

          java -Dwebdriver.chrome.driver="Path of the driver on which we want to execute test" -jar selenium-server-standalone-3.12.0.jar -role node -hub address of hub machine


5)   In the Similar way we can set up as many as node we require our node machine.




In this blog, I would be only creating and using only one chrome node.

By default, Grid runs on http://localhost:4444 so to validate setup we can click it and validate its console.
   


Now both our Grid Hub and Node are ready for execution.

To execute our protractor test on the grid now we need to make minor changes in our conf.js file.

In seleniumAddress we need to provide the path of our node machine and provide multiCapabilities of all the browser on node machine where we want to execute our test. Below is my conf.js file


Now if execute our protractor test we would be able to validate that the test is getting executed on the node machine on the specified browser.



Hub Server Logs

Node Server Logs
Protractor Execution Logs





SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
April 22, 2019 at 2:53 PM

How to fix this issue org.openqa.selenium.remote.DesiredCapabilities firefox
INFO: Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
FAILED: test
org.openqa.selenium.SessionNotCreatedException: Unable to create new service: GeckoDriverService
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'device address', ip: 'ip address', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181'
Driver info: driver.version: unknown

The issue was selenium grid was working perfectly in chrome driver but in firefox and ie its giving unable to create session in both driver please give me the solution for the issue

Reply
avatar