Selenium/C2/Installation-of-Add-ons-and-selenium-action-commands/English

From Script | Spoken-Tutorial
Revision as of 19:37, 27 November 2012 by Chandrika (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Title of script: Installation of Add-on's and Executing Action Commands in Selenium.

Author: Suman Pasupula

Keywords: Selenium IDE, Add-on's,Recording,Action commands.


Click here for the Slides


Visual Cue Narration
Slide 1 Welcome to the Spoken tutorial on Installing

Add-ons and Executing Action Commands in Selenium.

Slide 2


Let me introduce you to Selenium:

Selenium is an open source test automation tool

which has rich set of testing functions.

The operations are highly flexible.

Selenium IDE has a recording feature.

It can save the recorded tests in different supported formats like html, java, ruby, etc,.

Slide 3

Prerequisites :

To practice this tutorial, you should have some Knowledge about web application.

Slide 4

Learning Objectives :

In this tutorial, we will cover following topics:

How to install Selenium IDE add-on.

How to install Firebug add-on.

How to record on the Selenium IDE.

How to execute Action Commands.


Slide 5

System Requirement:

To practice this tutorial:.

I am using Ubuntu 11.04 as operating system.

The web browser is firefox 7.1 .

Slide 6

Display the slide of the url: http://seleniumhq.org/download

This is the url from where you can download Selenium.

Open the firefox browser.

On the browser window, please type, http://seleniumhq.org/download

Lets us see the installation procedure of Selenium IDE Add-on.

Open the firefox browser.

On the browser, please type, http://seleniumhq.org/download

click on the latest version link "Download version 1.5.0" to install the Selenium IDE firefox extension.

A small pop up window will appear.

Click on “Allow” .

Again, another pop up window will appear,

click on “install now”.

In this pop up Window, Click on “Restart now”.

This is done to finish the installation of selenium IDE add-on.

When we do this, our Firefox Web browser automatically restarts.


Go to "Tools" menu and click on Selenium IDE.

To confirm if the Selenium IDE is installed and also to open the Selenium IDE,

let us go to the "Tools" Menu.

Here we will find the Selenium IDE.

Click on it.

Selenium IDE window will appear.


This is how a Selenium IDE looks like.


Go to “Tools” menu and click on Add Ons

Type “firebug” in the search text box




Let us see the installation of firebug.

Go to “Tools” menu and click on “Add-ons”.

Here the add-ons tab will open.

Type “firebug” in the search text box,

which is at the top right hand side of the window.

Click on the search icon.

Here you will see the list of add-ons available.

Click on “firebug 1.8.4” and click on the “install” button.

The download will take a while depending on the speed of your internet.

Click on “Restart now”. To complete the installation of Firebug add-on,

Click on “Restart now”.

Again, here when we do so, Firefox Web browser restarts automatically.


Recording sample steps in Selenium IDE.



Shift to Firefox web Browser



I will show you how to record the google search webpage.


For an example,

Let us go to Firefox Browser which had restarted.

Go to the "Tools" Menu and Click on the Selenium IDE

By default, the IDE is in recording mode.

Please note that the actions that I perform from now on will be recorded by Selenium

until I click on the Stop recording button.

On the Browser window, let us type www.google.com and click on "Go".

In the google search text box , type "spoken tutorials" and click on "search" .

Here you will see the list of websites.

Let us click on the link of the website which contains spoken tutorials.

The spoken tutorial website is now open.

Click on the stop button


Click on "Save"

To stop the recording click on the STOP button of the Selenium IDE.

Now you can see a list of commands recorded in the selenium IDE table.

These are the actions we had performed on the targets.

The list of commands in the selenium IDE table is considered a test case.

Go to "File" menu and click on "Save".

Let us name this file as "FirstTestCase" and click on "Save".


Let us see the commands which have been recorded by Selenium

This is the base url : http://www.google.co.in/

Open command was used for opening the web page.

Click command was used to click on the text box for typing.

Type command was used for typing the search element name

and for this command the value is spoken tutorials.

Click command is used for clicking the search button.

ClickAndWait is used to click on the spoken-tutorial link.

This clicks and waits for the page to load.


Slide 7


Action commands.

Action commands are those which manipulate the state of the application.

They perform actions like "clicking a link" and "entering a value in a text box" on the application.

If an Action results in failure, for example,

if the command is unable to click a link ,

the execution of the current test stops automatically.


Go to the "Tools" Menu.


Click on the Selenium IDE


Type open.


Click on “play current test case” icon in the IDE.


Now, let us execute some of the most commonly used action commands.

Go to the "Tools" Menu which is on top.

Click on the Selenium IDE to open it.

Let us see how to use the “open command”.

In the selenium IDE base URL , let us type http://www.gmail.com .

Type open, in command text box.

Click on the “play current test case” icon .

Gmail window is now open.

Type “type” in the command box


click on firebug


Type “id=Email”


Type “spokentutorial.selenium”

---Let us see how to execute the “type command”.

“type command” sets the value of an input field, as though you typed it in.

Let us type “type” in the command box of selenium IDE.

Go to "View" menu and click on firebug or press F12 key on your keyboard.

A Firebug window will appear.

Click on "inspect button" which is seen on the left hand side of the firebug window.

Click on the "user name" text box in the gmail.

Here we can find the "user name" text box which is in the form of html code.

This will be highlighted in the firebug window.

The “id” of the “user name” text box in the firebug is also displayed.

Type “id=Email” in the target box.

“Id=Email” is the locator referring to the text field (Username).

Using this Id , Selenium is able to find the Username text field on the Application.

We will learn more about Locators in the Upcoming Tutorial.

Type “spokentutorial.selenium” in the value box.

Type “type”


Type “id=Passwd”


Type “Talentsprint”


Click on the next command line in selenium IDE table, type “type” in the command box.

Type “id=Passwd” in the target box.

Type “Talentsprint” in the value box.

Click on play current test case icon.

We will find that the values "spokentutorial.selenium" and "talentsprint" are typed in the text fields "Userid" and "password".

This is because we have used the Type command.


Type “clickAndWait”

---Let us see how to execute the "clickAndWait" command.

This command clicks on a link, button, checkbox or radio button.

Type “clickAndWait” in command box and “id=signIn” in target box.

clickAndWait clicks on an element.

Click on "play the current test case" icon.

Here, we have logged into gmail successfully.


Type “close”

Right click on "close" command

Click on execute this command.

---Now, Let us see the execution of "close" command.

Close command simulates the user by clicking on the "close" button in the titlebar of a popup window or tab.

Type “close” in the command box.

Right click on "close" command in the table.

Click on execute this command.

Here the window or tab is closed.


This is it on Action commands.

Slide 8

Assignment

As an assignment ,

Install the Selenium IDE Add-on

Record the action of opening the yahoo search webpage .

Open yahoo mail using '“'open'”' command.

Slide 9

About the Spoken Tutorial Project

Watch the video available at this url (http://spoken-tutorial.org /What is a Spoken Tutorial )

It summarises the Spoken Tutorial project

If you do not have good bandwidth, you can download and watch it

Slide no. 10

About Spoken Tutorial workshops

The Spoken Tutorial Project Team

Conducts workshops using spoken tutorials

Gives certificates to those who pass an online test

For more details, contact us at this email id. (contact@spoken-tutorial.org)

Slide no. 11

Acknowledgement slide

Spoken Tutorial Project is a part of the Talk to a Teacher project

It is supported by the National Mission on Education through ICT, MHRD, Government of India

More information on this Mission is available at this url (http://spoken-tutorial.org /NMEICT-Intro)


Slide 12

About the contributor


TalentSprint, Hyderabad

This is Suman Pasupula from Hyderabad signing off.

Thanks for joining.

Contributors and Content Editors

Chandrika