Selenium

Selenium IDE Tutorial

1.Introduction

In this tutorial, we are going to show how you can test your web app by Selenium IDE. Selenium IDE is the Firefox plugin, which can record the user browser action and run it automatically further. We are going to install the Selenium IDE, explain most useful controlls and panels, record the simple use cases and run it automatically by Selenium IDE, add the schedule for tests, export this test case to programming languages.

Selenium IDE has special commands. Selenium commands emulate user activities. You can emulate any user activities: insert the text, submit the form, navigate in apps, click on link, click on checkbox, select the options in combobox. The main benefic about Selenium IDE is that you don’t need to have any experience in programming languages. All you need is install the Selenium plugin, record the use activities and run the tests. It is so user-friendly. Selenium IDE uses the native browser API for testing, so you can use all specters commands, which Firefox browser supports. Let’s start to install the Selenium IDE.

2.Installation

First of all, we go to the download page and select the last version of Selenium ide there – http://docs.seleniumhq.org/download/

Download Selenium IDE
Download Selenium IDE

After we downloaded this plugin, Firefox browser offers to install this addons. You need to allow this process. Selenium IDE is installed and we can see the Selenium IDE button on the right-top corner in Firefox.

Selenium IDE Button
Selenium IDE Button

Then you need to open the Selenium IDE, you can click on this button or select the Selenium IDE in development tools in Firefox, as show below.

Open Selenium IDE plugins
Open Selenium IDE plugins

Selenium IDE looks as show below.

Selenium main controls
Selenium main controls

Let’s describe the main useful controll:

  • Record user activities – it is the toggle button, when it turns on, it records the user activities in the main browser window.
  • Run single test – it run the single selected test.
  • Run multiple tests – it run all tests, which it was opened in Selenium IDE.
  • Base url – this input box defines the webapp url, when we go to this url in main browser window, Selenium IDE startes to record all activities on this window.
  • Test case panel – this panel contains all user activities, which Selenium IDE records.

Next, we are ready to record our first test case.

3.Testing

Let’s imagine, that we need to test the searching function in this site – http://examples.javacodegeeks.com. First, we should turn the record button on, put the base URL and go to main browser window. We go to this site, find the search input, type the necessary text, submit the form. After that, we get the searching result and now we need to verify this result. We need to select the necessary element and open the right mouse menu, as show below.

User controlls
User controlls

This menu contains addition Selenium IDE options: list of available commands, assert’s commands. We need to select the assert command, if we want to check the result. Now our test case is ready and we can go to Selenium IDE to see how it looks in Selenium code.

Manual adding command
Manual adding command

How we can see the test case panel is fulled. This table contains the emulations user activities. Sometimes, we need to add the command manually.

You need to click on empty row in the table and fill the input controls below. Let’s run our test and see the result. We click on run button and wait until test finishs.

Run test
Run test

We need to save out test case, that we can use it further.

Save Test suite
Save Test suite

Sometimes, we need to run the test periodically. Selenium IDE supports this functionality too. Go to Main menu - Options - Schedule tests to run periodically, as shown below.

Schedule controll
Schedule controll

You can make the configuration in open windows. For example, we chose to run our test case every hour. Then you need to turn test schedule on.

Schedule config
Schedule config

Selenium IDE can export your case tests to your favorite programming languages.

Export test cases
Export test cases

4.Conclusion

In this article, we show you how you can use Selenium IDE to test your web apps. Selenium IDE is the great tool for building automations tests easily.

  • You can find more information about this tool on the official website link.

Petr Arsentev

Petr Arsentev has over 8 years of experience in java development. He participated in the development a few startup projects, which run successfully. He finished Moscow Power Engineering Institute (National Research University) at 2009. After he started to work in a local company as java developer and still keeps improving the knowledge about software developments. He focused on JVM languages like Java, Scala and related technologies and frameworks. He has developed the few courses about Java in Russian. He teaches students Java language too. This is his personal website http://parsentev.ru/
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button