selenium – testing tool jack

13
Selenium – Testing Tool

Upload: jackseen-jeyaluck

Post on 07-Nov-2014

1.223 views

Category:

Technology


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Selenium – testing tool jack

Selenium – Testing Tool

Page 2: Selenium – testing tool jack

What is Selenium? “A JavaScript based Open Source Web testing toolThat supports testing Web 2.0 applicationsOn multiple browsers And multiple Operating Systems”

•Selenium IDE is a plug-in to Firefox to record and playback tests (like WinRunner, QTP).

•You can then export the recorded test in most language e.g. HTML, Java , .NET , Perl , Ruby etc.

•The exported test can be run in any browser and any platform using "selenium remote control".

Page 3: Selenium – testing tool jack

Where to get it?• You can use Selenium-Core and customize everything – deprecated.

• But it is easier to just get a Firefox plug-in “Selenium-IDE” that helps you “record” test Cases.

• You can record how an app is being used and then playback those recordings followed by asserts.

• Get everything at: www.openqa.org/selenium/

Page 4: Selenium – testing tool jack

Selenium Modes

•Test Runner Mode test cases in HTML tables

•Record-Playback mode (Selenium IDE)

•Selenium Remote Control (RC) Mode test-cases in your language of choice

Page 5: Selenium – testing tool jack

• Integrated Development Environment for building Selenium test cases. • Operates as a Firefox add-on and provides an interface for developing and

running individual test cases or entire test suites. • Selenium-IDE has a recording feature, which will keep account of user actions as

they are performed and store them as a reusable script to play back. • It also has a context menu (right-click) integrated with the Firefox browser, which

allows the user to pick from a list of assertions and verifications for the selected location.

• Offers full editing of test cases.• Although it is a Firefox only add-on, tests created in it can also be run against

other browsers by using Selenium-RC & specifying the name of the test suite on the command line.

Selenium IDE

Page 6: Selenium – testing tool jack

• Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby.

• This ability to use Selenium-RC with a high-level programming language to develop test cases also allows the automated testing to be integrated with a project’s automated build environment.

Selenium-RC (Remote Control)

Page 7: Selenium – testing tool jack

Selenium-Grid allows the Selenium-RC solution to scale for test suites or test suites to be run in multiple environments.

• With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are sent to the hub they are then redirected to an available Selenium-RC, which will launch the browser and run the test.

• This allows for running tests in parallel, with the entire test suite theoretically taking only as long to run as the longest individual test.

Selenium- Grid

Page 8: Selenium – testing tool jack

1) Begin: write and run tests in Firefox. Selenium IDE is a Firefox add-on that records clicks, typing, and

other actions to make a test, which you can play back in the browser.

2) Customize: your language, your browser. Selenium Remote Control (RC) runs your tests in multiple browsers and platforms. Tweak your tests in your preferred language.

3) Deploy: scale out, speed upSelenium Grid extends Selenium RC to distribute your tests across multiple servers, saving you time by running tests in parallel.

Steps to start with Selenium!

Page 9: Selenium – testing tool jack

Browser Selenium-IDE Selenium-RC Operating Systems

Firefox 3 1.0 Beta-1 & 1.0 Beta-2: Record and playback tests Start browser, run tests Windows, Linux, Mac

Firefox 2 1.0 Beta-1: Record and playback tests Start browser, run tests Windows, Linux, Mac

IE 8 Under development Windows

IE 7 Test execution only via Selenium-RC Start browser, run tests Windows

Safari 3 Test execution only via Selenium-RC Start browser, run tests Mac

Safari 2 Test execution only via Selenium-RC Start browser, run tests Mac

Opera 9 Test execution only via Selenium-RC Start browser, run tests Windows, Linux, Mac

Opera 8 Test execution only via Selenium-RC Start browser, run tests Windows, Linux, Mac

Google Chrome Test execution only via Selenium-RC(Windows) Start browser, run tests Windows

Others Test execution only via Selenium-RC Partial support possible As applicable

* Tests developed on Firefox via Selenium-IDE can be executed on any other supported browser via a simple Selenium-RC command line.

Supported Browsers

Page 10: Selenium – testing tool jack

1) Actions are commands that generally manipulate the state of the application. They do things like “click this link” and “select that option”.

• Can be called with “AndWait” suffix, e.g. “clickAndWait”.

2) Accessors examine the state of the application and store the results in variables, e.g. “storeTitle”.

• They are also used to automatically generate Assertions.

3) Assertions are like Accessors, but verify that the state of the application conforms to what is expected. Eg. “make sure the page title is X”, “verify that this checkbox is checked”.

• All Selenium Assertions can be used in 3 modes: “assert”, “verify”, and ” waitFor”. For example, you can “assertText”, “verifyText” and “waitForText”.

Selenium Commands – Selenese

Page 11: Selenium – testing tool jack

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

Selenium IDE

Page 12: Selenium – testing tool jack

ExecutionCommands

Record testactions

Try the test inthe Web basedTestRunner

Specify commands,including asserts

Reference of thecurrently selectedcommand

Selenium IDE

Page 13: Selenium – testing tool jack

Useful Selenium Tools

Chris Pederick's Web Developer toolbarXPatherFirebugXpath Checker