Guide to Selenium IDE: Advantages, Components, and Features
As more organizations adopt the agile methodology, the demand for automation also increases. As the agile focus on timely faster delivery, manual testing may increase the delivery time. One of the main disadvantages of manual testing is that performing the regression takes more time and involves more resources and costs.
There are many automation tools in the market, such as Playwright, Cypress, Selenium, WebdriverIO, etc. Selenium is the most popular and most used tool in the market. Using these automation tools, one can integrate automation tests into CI/CD pipeline and run the tests without manual interruption. In this post, we’d talk in detail about its most popular component: Selenium IDE.
Table Of Contents
- 1 What is Selenium?
- 2 Components of Selenium
- 3 Understanding Selenium IDE
- 4 How to Install Selenium IDE?
- 5 Selenium IDE Features in Detail
- 6 Adding a new test using the Selenium IDE
- 7 Save Selenium IDE Tests
- 8 Selenium IDE Test Execution
- 9 Selenium IDE Debugging Options
- 10 Command Details Section
- 11 Adding Assertions using Selenium IDE
- 12 Convert Selenium IDE command to Any Programming Language Automation Test
- 13 Wrapping Up
What is Selenium?
Advantages of Selenium
- Open Source: Selenium is open source; no need to pay any cost, and it comes with Apache 2.0 License
- Cross-platform support: Selenium is available across the platforms (Operating systems). Windows, Mac, and Linux users can easily install and start using it.
- Multiple browser support: Selenium supports Chrome, Safari, and Firefox native browsers. It also supports age-old Internet explorer.
- Mobile device support: With the help of third-party libraries, Selenium tests can also be used for mobile testing.
- Test library support: The Selenium framework can easily be configured to test frameworks such as TestNG, NUnit, JUnit, XUnit, etc.
- Extendable: Selenium provides pure vanilla API libraries so one can extend or customize his own.
- Community Support: Since Selenium is used by many users worldwide, it has good community support, and most of your questions and doubts are answered in various forums. In addition to Selenium’s official documentation, many tutorials and learning videos are available across the web.
- Easy to start: Since many Selenium resources are available on the web, one can easily start the Selenium tests.
Disadvantages of Selenium
- Complicated Setup: Though you can learn Selenium easily, however setting up the entire framework takes more time. As Selenium is not ready to use framework, rather it provides the library; using that, one needs to build his own.
- Expert knowledge Required: Building a testing framework is not easy. It requires expertise in programming language and automation framework. Building a robust scalable testing framework using Selenium is as good as developing applications.
- No Reporting: Unlike Playwright and WebdriverIO, Selenium doesn’t provide any reporting. Building reporting requires integration of loggers and other utilities in the test framework.
- Image processing is still a nightmare: Whenever a tester needs to test image-based test cases integrating such features into the framework is still a nightmare. There is no in-built support to process images and execute image-based test cases.
- Test maintenance: Along with creating test suites, test maintenance is also difficult in Selenium as it requires a lot of time and resources.
- WebDriver pain: As and when the browser updates, you need to keep updating the webDriver. Furthermore, you need to install different webDriver on different devices. This increases maintenance.
- No Dedicated support: Though Selenium is an open source, you do not get dedicated support like Testsigma. If you are stuck on some issues and the forum doesn’t answer your question, then it may take a longer time to resolve the problems.
Components of Selenium
Selenium is misunderstood by many as WebDriver is the only component. That’s not true. Here are some of the components of Selenium:
Selenium WebDriver component provides libraries to automate the browser. It accepts the commands, processes, and actions on the browser. The WebDriver is browser specific. For example, to run the automation tests on Chrome, you need ChromeDriver; similarly, the specific driver is available for Firefox, Safari, etc.
Selenium Grid helps to run the test on multiple machines. It increases the speed of execution of Selenium tests. If you have a specific requirement to run a test against multiple browsers and operating systems, consider integrating the Selenium Grid.
Selenium IDE (Integrated Development Environment) is a record and playback tool. It is available as a browser extension or plugin. Selenium IDE helps beginners and manual testers to learn more efficiently. It also helps to speed up the automation of test cases. The Selenium IDE was created long before for Firefox. However, it has gone into a maintenance state over a period of time. The latest Selenium 4 release re-introduced the Selenium IDE with revamped user interface, new design, and more features.
Understanding Selenium IDE
From the previous section, you understood what Selenium IDE is. Let’s explore Selenium IDE in detail.
Selenium IDE is available as an extension/addon for Chrome and Firefox browsers.
Advantages of Selenium IDE
- No Coding knowledge required.
- Easy to install: just install as any other browser extension.
- Easy to debug: Selenium IDE provides many debugging features.
- Re-use of the test case is one of the advanced features in Selenium IDE. You can reuse the existing test cases.
- Add control flow statements such as if, while, times, etc., anywhere you want.
- Selenium IDE also provides customization. You can extend your IDE by building your commands, integrating third-party services, etc.
How to Install Selenium IDE?
Selenium IDE is available for both Chrome and Firefox as a browser extension.
Installing Selenium IDE in Firefox
- Navigate to https://addons.mozilla.org or type about: addons in URL bar.
- Search for Selenium IDE.
- Click on Add to Firefox.
Installing Selenium IDE in Chrome
- Navigate to https://chrome.google.com/webstore or type chrome://extensions in URL bar.
- Search for Selenium IDE.
- Click on Add to Chrome.
Selenium IDE Features in Detail
- Tests: New tests can be added using the + symbol available in the top right corner of the IDE window.
- Suites: Selenium tests can be grouped which is called Selenium Test Suite.
- Test Execution Menu: The Test execution menu provides options to Run Single Tests, Multiple Tests, Control the Execution Speed, Step over to the current command, etc.
- Project Options menu: The Project options menu provides Create new Test, Open existing Project, and Save the current project options.
- Base URL bar: This option is available below the Test Execution menu, which shows the recorded test case base URL.
- Recording /Debugging options provide disable breakpoints, pause the execution on exceptions, and Record new Test options.
- Command and Command Details: Once you record the test case, the commands table displays along with the target and value. The command details window helps you to modify any custom values.
- The Logs option provides run time execution logs, which help to analyze and understand why tests are failing or what is causing the issue.
Adding a new test using the Selenium IDE
When you launch the Selenium IDE, you get the below options.
- Record a new test in a new project
- Open an existing project
- Create a new project
- Close Selenium IDE
- Choose the 1st option, “Record a new test in a new project”
- Enter the Project Name (Example: Demo Project)
- Enter the Base URL (Example: https://google.com)
- Click on Start Recording
Let’s record the following scenario
- Open the Base URL
- Type the “TestSigma” as the search keyword
- Click on Search to View the Result
- Once Recording is complete, Switch back to Selenium IDE
- Click on the Stop Recording Icon
- The Selenium IDE prompts you to Enter the Test Name (Ex:DemoTest)
At this point, you can see the recorded tests in Selenium IDE.
Save Selenium IDE Tests
Selenium doesn’t save any recorded tests. Unsaved Tests are marked with *(star) next to the Project menu. To save the recorded project, click on the Save option available on the Top Right of Selenium IDE.
- Click on the Save option
- Choose the directory/folder location
- Click on Save
Did you know?
- Selenium Projects are always saved with .side extension.
- Once you save the project, you can always open it next time. Furthermore, the project is not browser dependent which means you can save the Selenium IDE project(side) using the Chrome browser and open it on the Firefox browser.
Selenium IDE Test Execution
Selenium IDE provides the option to execute the test through the IDE window. The Execution window provides following options:
This option will be helpful if you want to execute a single test in your project.
Execute Multiple Test
If your project contains multiple tests, you can execute them all at once, using the Execute all Test option.
Control Execution Speed
Using Selenium IDE, you can even control the execution Speed. Clicking on the Timer icon in the execution menu opens up the slider, and you can move from slow to fast and adjust the test execution accordingly.
Selenium IDE Debugging Options
Selenium IDE provides an easy way to debug the tests:
The logs section provides the execution logs that help to know which Selenium command is failing.
Once you know the command which is failing, you can add the breakpoint by navigating to the commands sections. Click on the number column to put the breakpoints; the execution stops at this point and helps to debug the tests.
Step over the current command helps to execute the commands one by one.
Pause on exception
On the right side, you can see the pause option. Instead of failing the test, this option pauses the tests if there is an exception, which helps to debug further from here.
Finally, Selenium IDE provides the disable breakpoint option. Even though you have set some breakpoints earlier, this will ignore the breakpoints and continue execution in an uninterrupted way.
Command Details Section
The command details section allows you to enable/disable selected commands
If your command opens up a new window, you can do the new window configuration option available in the command details section.
Target Section has two options.
- Select the target on the page: The target is your selector, while recording if you have chosen the locator wrongly, you can correct it using the Select the target in page option. You can simply click on the arrow and choose the locator on a webpage.
- Find the Target in page option helps to find the web element of the current command. Clicking on the Search icon in the target option highlights the web element in the browser.
The command details window also provides the option to modify the command value. For example, if you are typing the search keyword Testsigma and you need to modify the value to Selenium, you can do so by using the value option
In the end, it provides the description option, more like writing the comment on the programming, that helps increase the readability of your tests.
Additional options available in Selenium IDE
- You can clear the logs using the Clear Logs option available in the bottom right, which will clear all the logs from the previous execution.
- The Reference section provides a short description of the command that is used. For example, if you are using the click command, clicking on reference provides the purpose of the click command and its syntax with argument details.
- The top left drop-down provides an option to choose between tests, test suites, and executing tests, which will filter out tests accordingly. In addition, clicking on plus (+) symbol creates new Tests or Test suites based on what you have selected from the dropdown.
Adding Assertions using Selenium IDE
Interestingly, the Selenium IDE also provides options to assert. Assertion is very important in marking the test as pass or fail.
While recording the test, you can simply right-click on the browser. In the end, you can see the Selenium IDE menu.
Select the Selenium IDE menu > Click on Assert > Choose from various available assertions.
Once you select the assertion from the UI, the assert will be added as a command in your Selenium IDE.
Similar way, you can use other options like Mouse over, Verify, WaitFor and Store.
- Mouse over: If your test case needs to mouse over a specific element, use this option.
- Verify: Verify helps to make the soft assert, where your test will verify the element. Even if verification fails, test continues to execute and fails the test after completion. Whereas the assertion terminates the test execution.
- WaitFor: The waitFor waits for Element visibility, presence or editable, etc, before performing the next actions.
- Store: The store option helps store the text, value, or title in a variable and use it in subsequent steps.
Convert Selenium IDE command to Any Programming Language Automation Test
- Click 3 vertical dots, next to the test name
- Click on Export
- Choose the Programming languages you wish
- Click on Export and save it in the specific directory
Your recorded test case is available in your favorite programming language/framework.
The Selenium IDE is user-friendly and most useful for beginners and manual testers. It provides a lot of options and everything can be done with minimal understanding of programming languages. Adding assertions, exporting UI test cases into specific programming languages, and debugging features are remarkable.
However, there are many limitations of Selenium IDE. The stakeholders are most interested in automation reports. However, Selenium IDE doesn’t provide any report that you can share with stakeholders. The recorded tests are flaky, especially when the website uses the dynamic rendering the test case fails. Besides, Data-driven testing is complicated using the Selenium IDE. The Selenium IDE is a favorite tool for beginners and manual testers but it lacks consistent results.
Testsigma is an alternative to Selenium IDE with more consistent results and rich features. Testsigma is available as a SAAS product, and you do not need to bother about the installation and setting up of complex libraries. As it is a codeless automation tool, you don’t need any coding knowledge. Anyone who knows the product and has the mindset to test the product can start easily.
Unlike Selenium, Testsigma focuses on what matters most; for testers and the team, it is reporting. After execution, the detailed test reports are ready for sharing. Besides, the platform has a lot of features such as Integration with CI/CD, Test reports, modify/customize recorded tests, etc., and interestingly everything is available with zero configuration, without coding knowledge. Finally, you never get stuck in the middle of the test since Testsigma has detailed documentation and dedicated support to answer every query and solve any problem.