Skip to main content

Creating First Script in Selenium IDE

Selenium IDE Features:

You can use Selenium IDE without prior knowledge in programming. If you need to execute some test cases for every release, you can create test cases(script) in IDE and make it into Suites. Lets see how to create suites later.First we will see how to create a script.

Features Of Selenium IDE

IDE

Creating First Script in Selenium IDE:

To create a new script and play, Follow the below Steps:

Step1-Recording

Step2-Stop Recording

Step3-Edit the script(If needed)

Step4: Run The Script

Step5: Review the Results

Step6: Save the Test case

Lets create a testcase to verify the title “Automation Testing”  in http://onlinetraining.etestinghub.com/

 Recording:

  1. Open the IDE from Firefox, Its by default in recording mode, you can stop recording by clicking on red button.
  2. Now enter http://onlinetraining.etestinghub.com/ in Firefox browser
  3. Click on Menu
  4. Select Automation Testing
  5. Right click on Firefox browser (The right click opens the Selenium IDE context menu listing few of the commands. To get an entire list, select “Show Available Commands” option. This will open another menu containing rest of the available and applicable commands) and select command Verify Title ” Automation Testing”

 Stop Recording

StartStopIDE

Run the Script (Click on Run Button)

StartStopIDE

To run the entire Script click on Run button shown above. To run a particular command, lets say Open “onlinetraining.etestinghub.com” Just double click on that command.

Results:

If test is pass, it will show in green

IDE_Script pass

If Test is fail, it will show in red

IDE_Script Fail

Save the Test Case.

To save the test script, Click on the File menu and select “Save Test Case” option, The system will prompt us to browse or enter the desired location to save our test case and to provide the test script name.

Toolbar:  The toolbar contains buttons for controlling the execution of your test cases, including a step feature for

Menu Bar:

  1.   File Menu: The File menu allows you to create, open and save test case and test suite files.
  2.   Edit Menu: The Edit menu allows copy, paste, delete, undo and select all operations for editing the commands in your test case.
  3.  Options Menu: The Options menu allows the changing of settings. You can set the timeout value for certain commands, add user-defined user extensions to the base set of Selenium commands, and specify the format (language) used when saving your test cases.
  4. Help Menu

 Recording and Run settings:

When Selenium-IDE is first opened, the record button is ON by default.

During recording, Selenium-IDE will automatically insert commands into your test case based on your actions.

a. Remember Base URL MODE – Using Base URL to Run Test Cases in Different Domains

b. Record Absolute recording mode – Run Test Cases in Particular Domain.

Running Test Cases:

Run a Test Case Click the Run button to run the currently displayed test case.

Run a Test Suite:

Click the Run All button to run all the test cases in the currently loaded test suite.

Stop and Start The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume.

Stop in the Middle You can set a breakpoint in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, select a command, right-click, and from the context menu select Toggle Breakpoint.

Start from the Middle You can tell the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a startpoint, select a command, right-click, and from the context menu select Set/Clear Start Point.

Run Any Single Command Double-click any single command to run it by itself. This is useful when writing a single command. It lets you immediately test a command you are constructing, when you are not sure if it is correct. You can double-click it to see if it runs correctly. This is also available from the context menu.