31
Selenium – Testing Tool By:Pravin Mishra [email protected]

Selenium By Pravin Mishra

Embed Size (px)

DESCRIPTION

On 29th Jan 2012 present a presentation on Selenium, one of the fast growing & widely adopted testing framework At maisasolutions.

Citation preview

Page 1: Selenium By Pravin Mishra

Selenium – Testing Tool By:Pravin Mishra [email protected]

Page 2: Selenium By Pravin Mishra

Contents

• Why testing?

• Selenium Overview

• Benefits of selenium

• Component of selenium.

• Selenium IDE Introduction

• Installing Selenium IDE

• Running a Simple Test

• Installing Useful Tools for Writing Tests

• Creating Selenium Test Suites

• Questions?

Page 3: Selenium By Pravin Mishra

Why testing?

• Confidence=>Verification that our system behaves as it is suppose to.

• Manually

• Automated

->Automated testing is less painful and much easier.

Page 4: Selenium By Pravin Mishra

What is selenium?

• Selenium is an open source automation testing tool for automating web based applications. It can only automate web based applications. It works on multiple browsers and multiple operating systems. Being open source and very strong in nature, demand for this tool is increasing.

Page 5: Selenium By Pravin Mishra

Programming Languages

• Ruby.

• Java.

• C#.

• PHP

• Python

• Perl

Page 6: Selenium By Pravin Mishra

Browsers

• Mozilla

• IE 6,7,8

• Google Chrome

• Opera 8,9,10

• Safari

Page 7: Selenium By Pravin Mishra

Operating Systems

• Windows

• Mac

• Linux/Unix

Page 8: Selenium By Pravin Mishra

Benefits of Selenium - Open source

- Works on multiple browsers Mozilla,   Chrome, IE, Opera, Safari

- Works on multiple Operating Systems

- Supports many languages

- Tests Ajax Applications

- Tests Flash Applicatons

- Can do Database Testing

- Multiple test frameworks are supported

- Can be used for Functional and UI testing

Page 9: Selenium By Pravin Mishra

What is selenium IDE?

1. Record and run functionality.

2. It gets installed as an add-on on Mozilla and works only on Mozilla.

3. That's why RC or webdriver comes in picture.

4. We can write our own extensions and implement loops, if statements, use arrays, parameterize test cases.

5. All this is done with the help of user extensions. One needs to know JavaScript in order to do this because the core engine of IDE is JavaScript based.

Page 10: Selenium By Pravin Mishra

What is selenium RC(remote control)?

• Execute in multiple browsers, on remote machines• Automate Selenium tests from Java/.NET/Ruby etc• Integrate into wider business tests and CI tools

Page 11: Selenium By Pravin Mishra

What is selenium 2 OR web driver?• Selenium 2 or Webdriver is the new version of Selenium.

What is Selenium GRID• Run tests on multiple machines in parallel• Solves the biggest problem with Selenium, speed

Page 12: Selenium By Pravin Mishra

Installing Selenium IDE

• Installing Selenium is a two step process

– First: If Firefox is not installed in your machine then Install Firefox

– Second: If Selenium IDE is not installed on your machine then Install Selenium IDE Plug-in

Page 13: Selenium By Pravin Mishra

IE Version of Selenium

• Is there an IE version of Selenium IDE?

– No, at this point of time Selenium IDE works only for Firefox. You can write your test scripts via IDE and then use the Selenium Core TestRunner or Selenium RC to execute them on IE.

Page 14: Selenium By Pravin Mishra

Check Firefox Version• Click on the Mozilla Firefox• Go to Help About as shown below:• Check the version name• What is your version?

In this About Window, it shows Firefox version 2.0.0.16

Page 15: Selenium By Pravin Mishra

Installing Selenium IDE

• Open the Firefox browser window (*1)• Go to Tools Check whether Selenium IDE already exist

there (*2)• If you see “Selenium IDE”, Hurray, You are already having

Selenium IDE plug-in is installed in your Firefox browser• If not installed then follow the instruction on the next slide

Check whether Selenium IDE is already installed

*1

*2

Page 16: Selenium By Pravin Mishra

Installing Selenium IDE

• Open the Firefox browser window (*1)• In the navigation tool bar type the below URL:

– http://seleniumhq.org/download/– Under Downloads Choose Selenium IDE(*1)

Don’t do this in IE browser

Click download

Page 17: Selenium By Pravin Mishra

Installing Selenium IDE

• Click Allow if Firefox prevents to install

Click Allow

Page 18: Selenium By Pravin Mishra

Installing Selenium IDE

• When the Software Installation Window appears, select “Selenium IDE” (*5)

• Press Install button• “Selenium IDE” Add on is installed (*6)• Click on “Restart Firefox” button(*6)

*5

Restart to take effect of the

Selenium Plug-in

*6

Page 19: Selenium By Pravin Mishra

Installing Selenium IDE

• Now, in the Firefox browser go to Tools and verify whether “Selenium IDE” is displayed (*8).

• If found, then the Selenium IDE installation is completed. (Congrats !)

*8

Selenium IDE is successfully

installed

Page 20: Selenium By Pravin Mishra

Selenium IDE

Click Selenium IDE in the menu which will bring the Selenium IDE to you (*9)

The list ofactions in theactual test caseto execute

The root of web application youwant to test

The log of theevents that wereexecuted, includingany errors orwarning that mayhave occurred

Page 21: Selenium By Pravin Mishra

Selenium IDE

ExecutionCommands

Record testactions

Try the test inthe Web basedTestRunner

Specify commands,including asserts

Reference of thecurrently selectedcommand

Page 22: Selenium By Pravin Mishra

Test Creation Demo in https://login.secureserver.net

Page 23: Selenium By Pravin Mishra

Login to https://login.secureserver.net Click on Tools || Selenium IDE

Page 24: Selenium By Pravin Mishra

Selenium IDE in recording Mode

Page 25: Selenium By Pravin Mishra

Add Login Details

Page 26: Selenium By Pravin Mishra

Click On Submit

Page 27: Selenium By Pravin Mishra

Login Successfully

Page 28: Selenium By Pravin Mishra

Selenium IDE records the Test Steps

Stop Recording

Page 29: Selenium By Pravin Mishra

Save Test Case/Test Suite

Page 30: Selenium By Pravin Mishra

Run the entire Test Suite/Each Test CaseSee RESULT Here

Page 31: Selenium By Pravin Mishra

THANKS

Questions?

By:Pravin MishraRails/UI Developer

[email protected]