As part of explaining all the new features in the latest Selenium IDE, I will explain the configuration of Selenium IDE Command Line Runner.
Selenium IDE Command Line Runner is also known as Selenium IDE Runner or SIDE Runner in short. This command-line runner makes Parallel Execution and Cross Browser Testing possible in Selenium IDE.
In this article, I will explain practically the steps for configuring Selenium IDE Command Line Runner.
Let’s get started.
New Selenium IDE – Configuring Command Line Runner
Follow the below steps for configuring the Selenium IDE Command Line Runner in a step by step manner:
In order to install the Selenium IDE Command Line Runner, we have to first install nodejs in our machine.
Using nodejs we can install several npm packages available on the web. As Selenium IDE Command Line Runner also comes as the npm package, we have to first install nodejs and then using it we have to install the Selenium IDE Command Line Runner npm package.
I will explain the installation of nodejs in the below steps.
1) Open https://nodejs.org/en/download/ in any browser. Scroll down and click on Previous Releases
2) On Previous Releases, page Click on Node.js 10.x
3) Now Click on nodejs v10.15.3 .msi installer
4) After Downloading the Installer file, Start installing it. Below are the installation screenshots.
5) Open the command prompt in your machine and run node -v in the command prompt. The installed version of node.js should appear on command prompt.
Like-Like-wise we can confirm for NPM as well by writing npm -v.
This shows that nodejs has been installed and configured successfully.
6) As nodejs is now installed and configured successfully, we can install the Selenium IDE command line runner (i.e. SIDE Runner) by executing the below command in the above-opened command prompt as shown below:
npm install -g selenium-side-runner
7) We have to also install the npm packages for different browser drivers too.
For executing the Selenium IDE Tests on Chrome Browser using the command line SIDE Runner, we need to install the ChromeDriver by executing the below command in the above command prompt:
npm install -g chromedriver
For executing the Selenium IDE Tests on Firefox Browser using the command line SIDE Runner, we need to install the geckodriver by executing the below command in the above command prompt:
npm install -g geckodriver
For executing the Selenium IDE Tests on Internet Explorer Browser using the command line SIDE Runner, we need to install the IEDriver by executing the below command in the above command prompt:
npm install -g iedriver
For executing the Selenium IDE Tests on Edge Browser using the command line SIDE Runner, we need to install the EdgeDriver by executing the below command in the above command prompt:
npm install -g edgedriver
8) Let’s record a sample test in Selenium IDE as shown below:
Save the project having this Test into any folder in your machine as shown below:
Now, in the command prompt type the below command to execute the saved Project1.side
selenium-side-runner C:\Users\arunm\Desktop\Projs\Project1.side
Note: I have given the path of the saved Selenium IDE project in the above command
Observe that the recorded Test in the project failed to run as shown below:
Let’s follow the below step for adding the chromedriver path to your windows machine.
9) Open your chrome browser and check the version as shown below:
Go to seleniumhq.org/download page and click on the latest link of Chrome Driver as shown below:
In the displayed page, download the chrome driver which matches with the chrome browser version.
As we have Chrome Browser version 76 as shown in the above steps, lets select to download the appropriate chrome driver as shown below:
In the displayed page, click on windows chrome driver to download as shown below:
The Chrome driver for windows will be downloaded as shown below:
Extract the above-downloaded chrome driver zip file and keep it in any folder in your machine as shown below:
Now set the path of the above chrome driver in your machine by following the below steps:
First, copy the path of the folder in which the downloaded chrome driver exe file is available as shown below:
Open any folder as shown below:
Right-click on ‘This PC’ option and select ‘Properties’ as shown below:
Click or select on the different links, options in sequence as shown below:
In the displayed ‘Edit Environment variable’, click on ‘New’ button and then paste the path copied in the above step and click on the ‘OK’ button until all dialogs close:
Now, in the command prompt type the below command to execute the saved Project1.side
selenium-side-runner C:\Users\arunm\Desktop\Projs\Project1.side
Note: I have given the path of the saved Selenium IDE project in the above command
Observe that the Test got failed again with a different message – ‘Your test suite must contain at least one test’ message as shown below:
Let’s fix the above failure, by adding a Test to the default suite and then saving the project as shown below:
Now, in the command prompt type the below command to execute the saved Project1.side
selenium-side-runner C:\Users\arunm\Desktop\Projs\Project1.side
Note: I have given the path of the saved Selenium IDE project in the above command
Observe that the recorded Test in the Project got executed as shown below:
Once the Test got completed execute, the results will be displayed in the command line as shown below:
Here concludes the practical demonstration of configuring Selenium IDE Command Line Runner.
In the next article, I will practically demonstrate another new feature in the latest Selenium IDE. (new features in the latest Selenium IDE)
Next Steps:
- > Check complete Selenium Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?
On a mission to contribute to the Software Testing Community in all possible ways.
hi sir , i’m unable do cross browser test using selenium ide , every time after executing the code in nodejs by using selenium side runner it’s showing script is failed ,i do what ever having in your post ,but i’m unable to do cross browser test
please give me a solution and please do the how to do performance testing using selenium
Thank you
I am getting error for
C:\Users\SDN004\Downloads\scheduler\sec2.side
‘selenium-side-runner’ is not recognized as an internal or external command,
operable program or batch file.
Pls help
Hi Swarup
While installing selenium-side-runner, don’t forget to use -g in the command.
Regards,
Arun Motoori
Hello,
This presentation is very good.
I install this in my server and the execution of my test run correctly with good response.
But, when I run the scénario from JENKINS (on the same server)
I’m getting the same error :
‘selenium-side-runner’ is not recognized as an internal or external command,
operable program or batch file.
What is my mistake
Yes Swarup.
I even faced the same problem.
I too don’t have any solution for this at this moment.
after running the side file the browser close, it is possible to keep the browser open?
You can check with Applitools on this.
They have a chat feature, using which they reply.
@Filipe,
Did you get an answer? I tried:
selenium-side-runner -c “goog:chromeOptions.detach=true browserName=chrome” mytest.side
with no luck, it still closed the browser