Skip to content

Selenium

DeclanBuckley edited this page Aug 31, 2022 · 4 revisions

Home / Developer / Selenium

Selenium IDE is designed to record your interactions with websites to help you generate and maintain site automation, tests, and remove the need to manually step through repetitive takes. Features include:

  • Recording and playing back tests on Firefox and Chrome.
  • Organising tests into suites for easy management.
  • Saving and loading scripts, for later playback.

Launch the IDE:

Selenium_APP_Icon

Once installed, launch it by clicking the Selenium IDE icon ( as shown above) from the menu bar in your browser.

SeleniumLaunch

Step 1 : Project Name

First we must create a new project. Select the 'Create a new project' menu option.

A pop up window will appear prompting you to name your project. /Enter your name and click OK to continue.

Selenium

Step 2 : URL

Your new project window will open. You will need to add the URL of the webpage you wish to begin recording from. This is entered where indicated by the red line in the screen shot below.

Selenium_url

With your new project created and the URL details added save your project to a designated folder. You can use this folder to store your .side (Selenium IDE) project file and any other files you may want to use for automated testing (e.g. .px files, .CSV files etc.)

Selenium_save

Important : Remember to Save your project whenever you update it with more tests to ensure you don't lose any information.

Step 3 : Add a new Test

Selenium_add_test

To Add a new test click on the + sign to the right of the Tests menu option as shown above.

Selenium_test_case

An 'Add new test case' pop up window will appears. Enter your test name and click on 'ADD' to continue.

Step 4 : Start Recording

Selenium_record

To begin recording click on the red 'REC' icon as shown above.

Selenium_recording

Selenium will open your default URL with a warning that you are now recording. Perform your desired test and selenium will save the steps you follow.

Selenium_stop

To finish recording your test click on the red stop icon on the far right as shown above.

Once you have completed whatever steps you wish to record open the Selenium IDE window and click on the red square icon to Stop recording and complete your test. NB: Remember to save you project each time you add or remove a test to keep your changes.

Step 5: Playing back a test.

To play back a test I would amend the test application first. If you created a test to add a theme I would delete this theme from your test environment before running your recorded test. This way you can be sure your theme (or other test) is genuinely recreated. If a test runs successfully it will be marked in green on the test list. If it fails it will be marked in red and the log window will indicate where it failed. If Selenium IDE can't recreate a step it will time out after a short time.

To run a test highlight the test you want and click on the play button indicated below.

Run_test

Step 6 : Create a test suite.

You can easily create a suite of test. Select the drop down list for Tests and Select Test suites.

Selenium_suites

Click on the + to add a new suite as below and give it a name.

Selenium_add_Suite

Click on the three dots to the right of your newly created test suite and you will get the drop down menu shown below.

Selenium_suite_select

Selecting Add Tests will bring up a list of all your tests and you simply choose the ones you want for your suite.

Select_suite_tests

To run your suite of tests highlight the first test in your list and click on the run all tests icon indicated below

Run_suites

Editing the .side file for use by a different URL :

Each .side file needs a URL to run against. In order for one .side file to be used by another person against a separate test account or by the same person against a different URL ( e.g running the same tests against a test/live or development environment then the URL needs to be changed. I have not found a way to do this using the selenium IDE app. I have come up with a straightforward solution using notepad.

  1. If you open your existing Selenium file that you wish to test in a separate environment you will see that it has a default URL at the top and each individual test also shows this URL in its code as highlighted below :

Changing the default URL WILL NOT change the open command for each test. Rather than having to do a global replace once the test were recorded I removed all references to the URL in the .side apart from the global one we declared initially. This means we can just change this line in our file and don't need to do a global replace in the .side file.

Clone this wiki locally