Test Automation with Selenium

Slides:



Advertisements
Similar presentations
Designing Reusable Frameworks for Test Automation
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
Tutorial 6 Creating a Web Form
Selenium Automation Testing Suite of Tools
Pubman and Selenium tests. What is Selenium Selenium is a suite of Web application test automation tools for any browser on any operating system –Firefox,
Automating with Open Source Testing Tools Corey McGarrahan rSmart 01-July-08.
Selenium HP Web Test Tool Training
Test Automation Framework Ashesh Jain 2007EE50403 Manager Amit Maheshwari.
Introduction to eValid Presentation Outline What is eValid? About eValid, Inc. eValid Features System Architecture eValid Functional Design Script Log.
Web based testing: Chucklist and Selenium
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
© 2006, Cognizant Technology Solutions. All Rights Reserved. The information contained herein is subject to change without notice. Automation – How to.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Selenium Automation Testing Suite of Tools. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for.
Selenium Web Test Tool Training Using Ruby Language Discover the automating power of Selenium Kavin School Kavin School Presents: Presented by: Kangeyan.
Automation using Selenium Authored & Presented by : Chinmay Sathe & Amit Prabhu Cybage Software Pvt. Ltd.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Manage Engine: Q Engine. What is it?  Tool developed by Manage Engine that allows one to test web applications using a variety of different tests to.
WorkPlace Pro Utilities.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Selenium automated testing in Openbravo ERP Quality Assurance Webinar April 8th, 2010.
Val Kravets, Luis Sanchez, Allen Chung, Phillip Anderson, Leyla Norooz, Brian Ramnarian, Todd Watson.
Robot Framework – Basic Level. Date: Version:1.0 Page 1.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Testing Web applications. Selenium What is Selenium? Selenium is a suite of tools to automate web application testing across many platforms Tests run.
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Exploring an Open Source Automation Framework Implementation.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
DB2 Universal Database Confidential | July 2012 | India Software Lab Click to add text © 2012 IBM Corporation An End to End Windows Automation Framework.
Selenium and Selenium on Rails. Agenda  Overview of Selenium Simple Selenium Tests Selenium IDE  Overview of Selenium on Rails  Problems with Selenium.
Web Automation Testing With Selenium By Rajesh Kanade.
Pubman and Selenium tests. What is Selenium Selenium is a suite of Web application test automation tools for any browser on any operating system –Firefox,
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Selenium January Selenium course content  Introduction (Session-1)Session-  Automation  What is automation testing  When to go for automation.
Introduction Selenium IDE is a Firefox extension that allows you to record, edit, and debug tests for HTML Easy record and playback Intelligent field selection.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Test Automation For Web-Based Applications Portnov Computer School 1 Selenium HP Web Test Tool Training.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Selenium Date:06/10/2009. May 13, Agenda Testing – Test Automation Selenium – Introduction – Features – Supported platforms Selenium Commands –
SELENIUM By- Vivek Singh Jeena, Inderpreet Singh, Ankusha Saxena, Bhanupriya D.P, Shubham Yadav, Madhavi Aminigadda.
Selenium server By, Kartikeya Rastogi Mayur Sapre Mosheca. R
Test Automation Using Selenium Presented by: Shambo Ghosh Ankit Sachan Samapti Sinhamahapatra Akshay Kotawala.
Selenium & Web Accessibility Nishant Singh Sumedha Mitra Vivek Gupta Vishesh Mangal Biswajeet Mandal Srivash Kangsabanik.
Text Selenium server 31 – October By, Vivek Singh Jeena Inderpreet Singh Ankusha Saxena Bhanupriya D.P Shubham Yadav Madhavi Aminigadda.
Perfecto Mobile Automation
Tata Consultancy Services1 WebDriver Basics Submitted By : Akhil K Gagan Deep Singh Naveenrajha H M Poornachandra Meduri Shubham Utsav Sunil Kumar G Vivek.
Robot Framework – Basic Level. Date: Version:1.0 Page 1.
Tutorial 6 Creating a Web Form
Arklio Studija 2007 File: / / Page 1 Automated web application testing using Selenium
Selenium HP Web Test Tool Training
Selenium and Selenium on Rails
JRA2: Acceptance Testing senarious
Self Healing and Dynamic Construction Framework:
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
Selenium Web Test Tool Training Using Ruby Language
Selenium Tutorials Cheyat Training.
Selenium IDE Installation and Use.
Presentation transcript:

Test Automation with Selenium

Agenda Introduction to Selenium Demo An overview of the framework, and how it works Showcase the different ways of using Selenium Limitations of Selenium

Selenium Introduction

What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications Selenium is a combination of tools for functional tests, smoke tests, and integration tests of Web applications, including Rich Internet Applications (RIA, using Ajax.) A Java Script Based so work any where Embeds test automation engine in your browser Supported on Multiple Browsers

Why Selenium ? Cross Platform and Browser Compatibility The beauty of doing these scripts in Selenium is that you could run these scripts after they are just written and see instantly where they may need tweaking and amending Flexibility and Extensibility: Selenium’s strongest characteristic when compared with proprietary test automation tools and other open source solutions. Selenium-RC supports multiple programming and scripting languages. Allows running multiple tests parallely in single/multiple browsers Portability: Allows to record scripts in Windows and replay it in Linux without re-creating the script

Part 2: Demo

Selenium Components Selenium IDE Selenium RC Selinum Grid

Using Selenium IDE Integrated development environment for Selenium test Allows you to record, edit and debug tests.

Selenese – The language of Selenium Commands of Selenium Selenese consists of Actions, Accessors, Element Locators and Variables Actions – Combination of Command, Target and Value Command : Scripts perform a particular action on a web application Target : Typically take element locator Value : Value for any input Example: Open - Open a URL Click – Click button, link, etc... Type – Type text in text field There are only about 6 commands you need to know to be able to automate tests. Same as a manual test case really (open, click, select, type, assert (check), wait).

Selenese – The language of Selenium Accessors – Accessors examine the state of the application and store the results in variables. Verification / Validation checkpoints for the tool Example: Store (locator, variables) Verify (locator, pattern) They are also used to automatically generate Assertions Assertions – Assertions are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include "make sure the page title is X" and "verify that this checkbox is checked". All Selenium Assertions can be used in 3 modes 1. assert 2. verify 3. waitfor

Selenese – The language of Selenium Element Locator – These can be id, name, identifier, link, xpath, etc... Variables used in scripting Information regarding Actions, Accessors can be found in class ‘Selenium Driver’ in installed directory

Selenium – Locating Elements Using Firebug Tool Locating by XPath Rule 1: if value is assigned to any attribute Step 1 Inspect object Step 2 Look for first word say “Input” Step 3 start all xpath with // Step 4 [] Step 5 @ attribute Step 6 value ->> //input[@name="mname"] Rule 2: if value is not assigned to any attribute Step 2 Look for first word say “a” Step 5 text() Step 6 value ->> //a[text() = “Maps“] Rule 3: If two same objects are displayed on same page and you have to find out your choice of object //a[text()="Maps"]/following:: a[text()="Maps"]/]

Table or driver based? Table based approach fine for simple tests. No programming required Doesn't scale – duplication is a major issue Driver approach better for 'Real' test suites Can develop tests in language of choice C#, Java, Ruby, Python, Perl Easier data management via DB / Excel

Using Selenium RC Although Selenium-IDE is a Firefox only add-on, tests created in it can also be run against other browsers by using Selenium-RC and specifying the name of the test suite on the command line Selenium-RC allows the test automation developer to use a programming language for maximum flexibility and extensibility in developing test logic Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby.

Architecture

Configuring Selenium-RC With Eclipse Eclipse is a software that allows you to write and execute programs in many different languages. In our case we will be using Eclipse to write and execute Selenium via Java

Using Selenium Grid 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.

Know Issues & Workarounds Part 3: Know Issues & Workarounds

Selenese – Element not found on page Potential Cause: Can happen due to execution speed of selenium Elements do not load on page in time Fix: Add code in scripts which waits for elements Additional issues: Sometime existing elements on a page are not deleted Sometime elements on a page have same label Solution: Obtain exact element label from source code Label can be used in scripts for accuracy

Selenese – Handling of Popup Windows Steps: Window id required for automated operation in window Use following commands for handling alert messages: Put following commands before assertalert command 1) storeAlert and value ($variableName) 2) storeAlertPresent and value ($variableName)

Selenese – Handling of Frames Option: Multi-window option handles potential frame problems Cause: At times required name of frame not obtained in recording Fix: Obtain frame label from source code Also can be obtained from browser URL bar

Practice that we decided to implement Agile, Automation, and Continuous Integration Practice that we decided to implement Run Selenium tests as part of the build Run all acceptance tests in the regression test suite with the build, daily (at a minimum). [4] Run all unit tests with every build. [4] Run multiple builds per day. Can generate HTML reports, published to entire team Helps catch bugs ASAP Addresses risk of catching bugs late in the cycle

Why Selenium

Why Selenium ? Scripting capabilities Portability Validation & Verification Playback Options Reporting Capabilities

Why Selenium ? Scripting Capabilities Simplified Script Creation – In selenium, the default script is in html and it is the most common scripting language used among peoples. Keyword driven testing Standard Scripting Language allows you to easily create/update scripts without much programming knowledge Object Repository is not available in selenium but it is one of the features of all Functional testing tool Data driven Testing enables you to perform functional testing in different scenarios by just changing the test data in an external data source. Selenium supports Data driven testing Unicode supports allows you to test multi-language deployments of your applications Supports pattern-matching capabilities to improve test script reuse, if application changes frequently

Why Selenium ? Portability : Allows you to record scripts in Windows and replay it in Linux without re-creating the scripts Browser Abstraction Layer allows scripts recorded in one browser to be replayed in all other supported browsers Runtime locale option lets you to simultaneously test all language versions of your application with a single script

Why Selenium ? Validation and Verification Rich Library of Built in function added using the Function Generator tool. This helps you to construct function calls for specific testing requirements which include: In selenium, user has to create Built in function for their testing. Checkpoints that include Text, GUI, XML, File and Database enable thorough validation of your web applications/web sites. In selenium, there is a similar thing for checkpoint called verify or asset. But user can't able to check for images/bitmap. If user wants to check for database then they have to create a database connection with JavaScript and put it in userextensions.js but not sure about creating check points in the database. I left the choice to the user.

Why Selenium ? Playback Options Automatic/Customizable Error Recovery for unattended testing to handle unexpected window, like an ASSERT box, pop- ups, etc. But automatic error recovery for unattended testing is not available for selenium but user can write his/her own scripts to handle this. Playback Synchronization to handle the variation in time the application takes to load a new page. Ex: In selenium ClickAndWait is a command which will wait for the page to load and start executing the next command. Option to chain scripts for controlling the order of script execution. In selenium core, we can do the order of execution and if user wish he can execute everything as a batch file. Multiple Play back options that enables testers to debug test errors while creating and maintaining test scripts. Selenium supports multiple play back options. Allows execution of individual and/or groups of tests from one or many workstations. Provision for command-line invocation allows invocation from batch files or scheduling utilities.

Why Selenium ? Reporting Capabilities Clear and Powerful Reports are provided to indicate the status of the test execution. Hyperlinks or color coding (RED color for failure) allow easy navigation through the report. This helps you to quickly identify application failures and clearly assess application quality.

Why Selenium ? Compatibility Testing: Today organizations trying to automate their web applications/web sites are looking for a uniform testing solution. This will help them to reuse test scripts to test it in different platforms/different browsers/different languages/different databases/different servers

Thanks