Top Banner
Selenium Test Web Applications Using Selenium A Web Club NITK Talk Date : 03.02.2015
18
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Selenium ppt

Selenium

Test Web Applications Using Selenium

A Web Club NITK Talk

Date : 03.02.2015

Page 2: Selenium ppt

Test Automation● Test automation is the use of software

To set test preconditions.To control the execution of tests. To compare the actual outcomes to predicted

outcomes.To report the Execution Status.

● Commonly, test automation involves automating a manual process already in place that uses a formalized testing process.

Page 3: Selenium ppt

Why and When To Automate?● Frequent regression testing● Repeated test case Execution is required● User Acceptance Tests● Faster Feedback to the developers● Reduce the Human Effort● Test same application on multiple

environments

Page 4: Selenium ppt

Selenium● Selenium is a robust set of tools that supports

rapid development of test automation for web-based applications.

● Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application.

● Selenium operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.

Page 5: Selenium ppt

Selenium Features● Supports Cross Browser Testing. The

Selenium tests can be run on multiple browsers.

● Allows scripting in several languages like Java, C#, PHP and Python.

● Assertion statements provide an efficient way of comparing expected and actual results.

● Inbuilt reporting mechanism.

Page 6: Selenium ppt

Selenium Components

● Selenium Web Driver● Selenium IDE● Selenium Remote Control● Selenium Grid

Page 7: Selenium ppt

Selenium Web Driver

● WebDriver is a tool for automating testing web applications. WebDriver interacts directly with the browser without any intermediary.

● Multi-browser testing including improved functionality for browsers.

● Handling multiple frames, multiple browser windows, popups, and alerts.

● Complex page navigation.

● Advanced user navigation such as drag-and-drop.

● AJAX-based UI elements.

Page 8: Selenium ppt

Architecture

Page 9: Selenium ppt

Installation

● http://www.seleniumhq.org/download/● In order to create scripts that interact with

the Selenium Server (Selenium RC, Selenium Remote Webdriver) or create local Selenium WebDriver script you need to make use of language-specific client drivers.

● Ruby,Java, C#, Python, Node.js

Page 10: Selenium ppt

Sample Script to Test a page

Page 11: Selenium ppt

Most used CommandsCommand Description

driver.get("URL") To navigate to an application.

element.sendKeys("inputtext") Enter some text into an input box.

element.clear() Clear the contents from the input box.

driver.switchTo().window("windowName")

Move the focus from one window to another.

driver.navigate().to("URL") Navigate to the URL.

driver.close() Closes the current browser associated with the driver.

driver.quit() Quits the driver and closes all the associated window of that driver.

driver.refresh() Refreshes the current page.

Page 12: Selenium ppt

Selenium - Grid

● Selenium Grid is a tool that distributes the tests across multiple physical or virtual machines so that we can execute scripts in parallel (simultaneously). It dramatically accelerates the testing process across browsers and across platforms by giving us quick and accurate feedback.

● Selenium Grid allows us to execute multiple instances of WebDriver or Selenium Remote Control tests in parallel which uses the same code base, hence the code need NOT be present on the system they execute. The selenium-server-standalone package includes Hub, WebDriver, and Selenium RC to execute the scripts in grid.

Page 13: Selenium ppt

Selenium grid Architecture

Page 14: Selenium ppt

Selenium IDE● Selenium IDE is an integrated development

environment for Selenium tests. ● It is implemented as a Firefox extension, and

allows you to record, edit, and replay the test in firefox

● Selenium IDE allows you to save tests as HTML, Java, Ruby scripts, or any other format

● It allows you to automatically add assertions to all the pages.

● Allows you to add selenese commands as and when required

Page 15: Selenium ppt

Selenium IDE - UI

Start and Stop Recording

Selenese ScriptEditor

Selenium Log

ReplayToolbar

Accessor Area

Page 16: Selenium ppt

Other Uses of selenium

● Crawling webpages . Also, AJAX crawling.● Responsive Testing.● Scraping content from webpages. In

particular, the ones which don't provide an API and load content lazily using Javascript.

Page 17: Selenium ppt

Future Of Testing & Selenium

`

Page 18: Selenium ppt

Thank you :)

Mail : [email protected]