In this article, let's learn what Selenium and Selenium IDE are, how to install Selenium IDE for Firefox and use it to test a C# ASP.NET Web application. We can install the plugin for chrome as well. I’ll install it for Firefox.
Let’s get started.
Selenium
It’s a web testing framework. It’s a tool/framework used to automate multiple Web browsers. It’s a unified API for manipulating the web browsers. Below are the components of selenium
- Selenium IDE
- Selenium WebDriver
- Selenium Server [Formerly the Selenium RC server]
Let’s discuss about selenium IDE in this article.
Selenium IDE
Selenium IDE acts like a recorder. It’s a Chrome and Firefox plugin which allows us to record scripts and automated web tests and play them back. However, it’s not the recommended way to do automate web testing.
As in selenium IDE, we record each and everything when we browser and test a web site and play them back. We can create separate test cases, create test suites, execute them and then use those scripts to re-run the saved test cases. It will generate commands, targets and values automatically as we record.
This is a powerful tool to learn Selenium, capturing elements in a framework. We can able to see the scripts and test cases automatically generated by selenium recorder.
How Selenium IDE Works
It’s a recording tool, we can record steps and the Selenium IDE will generate commands, the commands generated by selenium IDE are also call Selenese. We can add/insert new command in between these auto generated commands and play/Run the recorded test.
Requirements
Selenium IDE a Firefox plugin, so in order to work with selenium IDE you must have Firefox installed. To install Mozilla Firefox, click here to download it first before moving forward.
Install Selenium IDE for Firefox
Once you installed Mozilla Firefox, let’s get started to add Selenium IDE plugin.
STEP 1: Open link
Open Firefox and Go to https://www.seleniumhq.org and click on Downloads as shown.
STEP 2: Go to Selenium IDE and download
You can see there is selenium IDE and click on release version for Firefox as shown in below diagram
STEP 3: Add to Firefox
As you click, a new page opens up, click on “Add to Firefox” button
STEP 4: Install Selenium IDE plugin
Let Firefox completes downloads and then click on Add button, it adds Selenium IDE as a plugin
STEP 5: Selenium IDE plugin added on top right corner
After installation complete, a confirmation message will appear at the top right corner saying “Selenium IDE has been added to Firefox”. Click OK.
And the plugin appeared on the top right corner of the browser window as an icon
shown below,
Open Selenium IDE
Click on selenium icon on top right corner, choose any option
- Record a new test in a new project
- Open an existing project
- Close selenium IDE
Record a new test using Selenium IDE
Enter PROJECT NAME
I selected “record a new test in a new project”. Fill the project Name and click OK button.
Enter BASE URL
BASE URL - the url of the web application for which you would like to record and generate test cases.
Now enter the BASE URL, I enter http://google.com to record a test case, you can use your website base url to record a test case. After this click on start recording button.
Start Recording a test case
Firefox will open Base URL [ as you specified in sleenium IDE, there I specified google.com so it opened http://google.com for me ] in a new window.
Let's record a test case for searching “C# Corner” in google and click on first link and open c-sharpcorner.com.
Now enter content “C# Corner” to search and hit Google search.
NOTE
You can see Selenium IDE is recording below that means Selenium IDE is recording each step as you perform here in the Firefox window.
Now result displayed for our search click on the first link, Selenium IDE is recording each and every single action you perform on the page. Here it says recorded Click means click command recorded in the Test step.
Link opened and the selenium IDE is recording as shown. Close the window.
Stop Recording
Click on STOP Recording.
Provide a TEST NAME and click OK.
Test Case with all the steps as we performed is created as shown below:
- Project Name is shown in the left side
- Use play to run a test case
- Command, Target and value are mentioned below the Base URL as shown.
Click on Play button to run the current test.
Test case1 executed successfully and we can see the execution of steps performed in the logs as shown below.
SUMMARY
In this article we learned the following:
- What Selenium is
- What Selenium IDE is
- How to install the Selenium IDE for Firefox
- Record a new test using Selenium IDE
- Generate a test Case – search on google
- Execute the test case that created by selenium recorder.
In the next article I’ll cover the Selenium Web Driver and how to write test cases using the Selenium Web Driver. Happy reading.