Is it possible to release any feature of a software product without passing through the QA or testing phase? The answer is a big NO! Testing should ideally be started in the staging environments since it helps in locating bugs at early stages of the product life cycle. Such a strategy is instrumental in ensuring that not many bugs (particularly severe) get into the production.
With the rapid proliferation of mobile phones and mobile internet, consumers across the globe are using mobile devices for accessing websites & applications. As per reports[1], there is a gradual rise in preference for web applications when compared to native applications. For starters, web applications are basically applications (i.e. websites) that run inside a web browser.
In the case of mobile devices, web applications (or mobile view of websites) can be accessed by simply keying in the URL into the preferred web browser on the mobile. Depending on the User Agent, the web browser will inform the website whether the request is coming from a mobile device or not. For example, opening Facebook website on a web browser on a mobile device will automatically route you to Facebook mobile site. The same principles also apply to any mobile-compatible website when it is accessed from a mobile web browser.
Since your consumers have the flexibility to access the website from their preferred choice of browser and platform (i.e. Android or iOS), it is essential to do a rigorous testing of the web application on the preferred browser & OS combinations. This is also termed as cross-browser compatibility testing. It is recommended to onboard an experienced web application testing company in case your team does not expertise in planning and running web application tests.
You can leverage code-based as well as codeless automation testing tools like Selenium IDE for running web application tests. Non technical personnel can also participate in web application testing when tests are executed using codeless automation tools. In this blog, we deep dive into every aspect of Selenium IDE for web application testing.
Also Read – Why To Choose Selenium Framework For Automation Testing?
What is Selenium IDE?
For starters, Selenium is a popular test automation framework that is primarily used for cross browser testing. The Selenium framework supports programming in six popular programming languages – Python, Java, JavaScript, C#, PHP, and Ruby. At the time of writing this blog, the latest version of Selenium was v4.5.0
The question is:
Can Selenium be used to write front-end tests if the tester does not have coding expertise?”
The answer is “Yes!”. Non-technical personnel or testers with minimal to no expertise of coding can use Selenium IDE for creating tests. Selenium IDE is a simple, yet effective Record & Playback tool that lets you record actions that are performed on the WebElements in the DOM (Document Object Model). Consider a simple scenario like searching “KiwiQA on Google” where you have to type the search query by instantiating the Chrome browser. After the browser is invoked, the search box and Submit button have to be located so that the required operations can be performed.
All these operations can be recorded as well as played using Selenium IDE – a browser extension that lets you record and play tests.
There is no special setup required to use Selenium IDE. The Selenium IDE project is hosted on GitHub. At the time of writing this blog, the project had garnered close to 2.2k stars and 621 forks. 4.0.0-alpha.15 was the latest version of Selenium IDE when we started working on this blog.
Also Read – All You Need to Know About Selenium WebDriver Architecture
How to install Selenium IDE?
The best part about using Selenium IDE is that it does not require any special installation. At the time of writing this blog, Selenium IDE was available for Chrome, Firefox, and Edge browsers.
Since Selenium IDE is an open-source project, you can also download and build the IDE manually. To build Selenium IDE, please refer to the Building Selenium IDE section on GitHub.
Shown below is a screenshot of Selenium IDE running from the Chrome browser:
Now that we have installed the Selenium IDE for Chrome browser, we will look at how to record & play tests using the IDE in the subsequent section of this blog.
Major Features of Selenium IDE
Now that we have covered the basic aspects of Selenium IDE, lets look some of the salient features of the IDE:
Web Ready
Selenium IDE works out of the box for testing any kind of web application. It is available as an add-on (or extension) for all the major web browsers.
The IDE can also be used to record and play E2E (End-to-End) tests. A web application testing services company can help you in making the most out of the IDE.
Also Read – Selenium 3 vs. Selenium 4 – What are the Major Differences?
Cloud-based Cross Browser Testing
There are umpteen advantages of cross browser testing, the major ones being uniform end-user experience on a range of browsers, platforms, and devices. Apart from using Selenium IDE with local web browsers, it can also be used for cross browser testing on cloud-based Selenium Grids.
The SIDE runner for Selenium IDE facilitates the cross browser testing. It is very easy to port an existing recording such that it runs tests on cloud Selenium grid. With such an approach, you can achieve greater browser and test coverage; thereby improving the overall product quality.
Enhanced Debugging
Selenium IDE was completely re-architectured in Selenium 4. The Selenium IDE supports debugging of test scripts whereby you can insert breakpoints during the test execution process.
You can also pause the test execution by pausing when the test encounters some exception. With this, you can test as well as debug your test scripts just like any normal piece of source code.
Export Tests to Preferred Languages
The new Selenium IDE not only lets you record and play tests but also lets you export the tests in your preferred choice of language and framework. This particular feature can be a good starting point for someone looking to leverage the Selenium automation framework for web application testing.
At the time of writing this blog, the Selenium IDE could help you export tests in the following languages and/or frameworks:
- C#: NUnit, xUnit
- Java: JUnit
- JavaScript: Mocha
- Python: PyTest
- Ruby: RSpec
Test Resilience
Flaky tests are a big problem for anyone dealing with front-end testing. There is a high possibility that the locators might stop working in case there are changes in the design.
This is where Selenium IDE can be super helpful, as it records multiple locators for all the WebElements in the DOM. In case one web locator is not successful, the Selenium IDE will move on with the other locators till it encounters a success. All these steps go a long way in improving the resilience of the tests, thereby reducing the flakiness quotient of the tests.
Test Reusability
Many Record & Playback tools struggle to pick up pace since there is no provision to build (or record) tests that can be reused across scenarios. However, this is not the case with Selenium IDE 🙂
Source
The run command in the IDE lets you reuse one test inside another. What this essentially means is that you can use an entire piece of test logic at multiple places within a test suite. This reduces the overall size of the test suite.
Control Flow Mechanism
Many playback & records only record steps in a serial fashion i.e. there is no way to add some control flow logic like if..else, etc. in the recorded test. Contrary to that, Selenium IDE comes with an extensive control flow structure through which you can use the following commands:
- if, else, if else, end
- times, end
- while, end
These commands aid in introducing conditional branching, looping, and nested commands in the test suites. You can refer to the Selenium IDE Control Flow documentation for more information since covering every aspect of it is beyond the scope of this blog.
Apart from all the above features, Selenium IDE also supports provision to extend its capabilities by adding third-party plugins.
How to run web application tests using Selenium IDE?
Now that we have covered all the important aspects of Selenium IDE, let’s look at how you can record and play recorded tests using the IDE.
Step 1
Install the Selenium IDE extension (or add on) for your preferred browser – Chrome, Firefox, or Edge
Step 2
Click on the Selenium IDE icon in the web browser. As soon as you do the same, it will show an option that lets you open a recorded test, open a new test, and more.
Step 3
Click on Record a new test in a new project to start recording the test. Provide a relevant project name (e.g. KiwiQATesting) and click OK
Step 4
Enter the base URL as https://www.google.com since we would be searching “KiwiQA” on Google. Once done, click on the Start Recording button.
Step 5
A new Chrome window will open-up. The Selenium IDE is recording button is an indicator that the recording is in progress.
Step 6
Enter the search term as ‘KiwiQA’ and press the Google Search button on the page. Maximize the browser window and click on the first test result.
Step 7
Click on the Selenium IDE is recording button. This will take you back to the Selenium IDE where you need to press the Stop button.
Step 8
Enter the test name (e.g. GoogleSearch) and press OK
Step 9
Voila! With this, your recorded test is available for playback.
You can now play the tests, edit the same, or even add conditional statements in the test. We would be covering advanced features of Selenium IDE in subsequent blogs.
Conclusion
Web application testing on different browser and platform combinations has become an absolute necessity. Selenium IDE is one of the powerful record & playback tools that can be leveraged for front-end testing. The massive advancements in the IDE as a part of the Selenium 4 project makes it a more feasible option for running codeless automation web application tests. Coltron flow mechanism and code export features make the Selenium IDE much more usable!
So, How do you perform web application testing? Do leave your approach in the comments section.