Lec 18 Web with Selenium 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 16 Testing Web Applications 10/23/2013 1.

Slides:



Advertisements
Similar presentations
Facts about Welcome to this video from Ozeki. In this video I will present what makes Ozeki Phone System XE the Worlds best on-site software PBX for Windows.
Advertisements

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,
Copyright © 2012 Certification Partners, LLC -- All Rights Reserved Lesson 4: Web Browsing.
Selenium HP Web Test Tool Training
Test Automation Framework Ashesh Jain 2007EE50403 Manager Amit Maheshwari.
Lesson 4: Web Browsing.
Automated Testing Nathan Weiss April 23, Overview History of Testing Advantages to Automated Testing Types of Automated Testing Automated Testing.
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
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.
Web Design Basic Concepts.
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
User Extensions, RC and Web Driver Anton Angelov QA Engineer SystemIntegrationTeam Telerik QA Academy Telerik QA Academy.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
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.
Testing Web applications. Selenium What is Selenium? Selenium is a suite of tools to automate web application testing across many platforms Tests run.
MIS 425 Lecture 3 – HTML 5 and CSS Instructor: Martin Neuhard
Testing Ajax Applications when to test, what to test, how to test Ajax applications Square One University Series.
ITCS373: Internet Technology Lecture 5: More HTML.
Testing Web Applications. Plan The presentation covers: Selenium framework Spring MVC Test framework HttpUnit 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.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
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.
SOAP-based Web Services Telerik Software Academy Software Quality Assurance.
WARSZAWQA#10.  Author: Michal Lamperski  Contact:  Find me on LinkedIn.
Selenium January Selenium course content  Introduction (Session-1)Session-  Automation  What is automation testing  When to go for automation.
Lec 19 Web Driver 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 19 Selenium Web Driver 11/4/
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.
Mohit Anand, Software Engineer Adobe 1 Selecting GUI Automation Testing Tool for Mobile Domain.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Unit 13 –JQuery Basics Instructor: Brent Presley.
Chapter 1 Introduction to HTML, XHTML, and CSS HTML5 & CSS 7 th Edition.
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.
Text Selenium server 31 – October By, Vivek Singh Jeena Inderpreet Singh Ankusha Saxena Bhanupriya D.P Shubham Yadav Madhavi Aminigadda.
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.
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
QA Online Training In QA Click Academy. Selenium is a test automation framework used to test web applications such as browsers. It consists of different.
Master Software Solutions Pvt.Ltd.. These days the demand of smart phone is being increased and we have different types of client e.g. Touch Phone, tables,
Google Web Toolkit for Mobile Applications Development INGENUITY AT ITS BEST……………….
What is Selenium Web Driver? - Selenium Training Collection.
Arklio Studija 2007 File: / / Page 1 Automated web application testing using Selenium
Introduction of Selenium Eli Lu 2016/10/13. Outline What is selenium ? Selenium Projects Selenium Sponsors Easy to use Useful Feature & Tools Useful Links.
Test Web applications using Selenium
Leverage your Business with Selenium Automation Testing
Selenium HP Web Test Tool Training
The Zen of UI Test Automation
Selenium and Selenium on Rails
JRA2: Acceptance Testing senarious
Human Computer Interaction
Introduction of Selenium Webdriver Using Java
Automating GUI testing with Selenium WebDriver, Java and Eclipse
CSCE 747 Software Testing and Quality Assurance
What is selenium? Selenium is a portable software-testing framework for web applications. Selenium provides a playback (formerly also recording) tool.
Haden Jackson-Robbins
Selenium Web Test Tool Training Using Ruby Language
CSCE 747 Software Testing and Quality Assurance
CSCE 747 Software Testing and Quality Assurance
Presentation transcript:

Lec 18 Web with Selenium 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 16 Testing Web Applications 10/23/2013 1

Lec 18 Web with Selenium 2 CSCE 747 Fall 2013 Last Time  GUI testing 2  Chapter 19 Today  Test 1 take-home  TestingGeek  Testing Web Applications  Selenium

Lec 18 Web with Selenium 3 CSCE 747 Fall 2013 Locating elements using public void testFindElements() { //Get all the links displayed on Page List links = driver.findElements(By.tagName("a")); //Verify there are four links displayed on the page assertEquals(4, links.size()); //Iterate though the list of links and print //target for each link for(WebElement link : links) System.out.println(link.getAttribute("href")); } Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 4 CSCE 747 Fall 2013  How it works... The findElements() method returns all the elements matching with the locator specified as a list of WebElements.  In Java, we can use the List class to create an instance of list of WebElements. List links = driver.findElements(By.tagName("a"));  The size() method of the List class will tell us how many elements are there in the  list. assertEquals(4, links.size());  We can iterate using this list in the following way, getting a link and printing its target value:  for(WebElement link : links)  System.out.println(link.getAttribute("href")); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 5 CSCE 747 Fall 2013 Finding a link by its text  Selenium WebDriver's By class provides the linkText() method to locate links using the text displayed for the link. In the following example, we will locate the GMail link: WebElement gmailLink = driver.findElement(By.linkText("GMail")); assertEquals(" gmailLink.getAttribute("href")); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 6 CSCE 747 Fall 2013 Finding a link by partial text WebElement inboxLink = driver.findElement(By.partialLinkText("Inbox")); System.out.println(inboxLink.getText());  See also The Locating an element using the findElement method recipe  The Locating elements using findElements method recipe Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 7 CSCE 747 Fall 2013 Locating by Tag Name WebElement loginButton = driver.findElement(By.tagName("button")); loginButton.click();  Take another example where we want to count how many rows are displayed in. We can do this in the following way: WebElement table = driver.findElement(By.id("summaryTable")); List rows = table.findElements(By.tagName("tr")); assertEquals(10, rows.size()); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 8 CSCE 747 Fall 2013 CSS  visit e_Sheets.  DOM Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 9 CSCE 747 Fall 2013 CSS – Absolute Paths WebElement userName = driver.findElement(By.cssSelector("html body div div form input"));  You can also use the previous selector in the following way by describing the direct parent to child relationships with > separator: WebElement userName = driver.findElement(By.cssSelector("html > body > div > div > form > input")); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 10 CSCE 747 Fall 2013  WebElement loginButton = driver.findElement(By.cssSelector("input.login"));  WebElement loginButton = driver.findElement(By.cssSelector(".login"));  WebElement userName = driver.findElement(By.cssSelector("input#username"));  WebElement userName = driver.findElement(By.cssSelector("#username"));  WebElement userName = driver.findElement(By.cssSelector("input[name=userna me]")); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 11 CSCE 747 Fall 2013  WebElement previousButton = driver.findElement(By.cssSelector("img[alt='Previous']"));  WebElement previousButton = driver.findElement(By.cssSelector("input[type='submit'][v alue='Login']"));  List imagesWithAlt = driver.findElements(By.cssSelector("img[alt]"));  List imagesWithoutAlt = driver.findElements(By.cssSelector("img:not([alt])")); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 12 CSCE 747 Fall 2013 Performing partial match on attribute values  ^= -starting with- input[id^='ctrl']  $= -ending with- input[id$='_userName']  *= -containing- input[id*='userName'] Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 13 CSCE 747 Fall 2013 Locating elements using XPath  WebElement userName = driver.findElement(By.xpath("html/body/div/ div/form/input"));  assuming it is the first element in the DOM:  WebElement userName = driver.findElement(By.xpath("//input")); Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 14 CSCE 747 Fall 2013 HTML Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 15 CSCE 747 Fall 2013  doc intro Selenium Testing Tools Cookbook by Gundecha – 2012

Lec 18 Web with Selenium 16 CSCE 747 Fall 2013 Selenium Documentation  Note to the Reader–Docs Being Revised for Selenium 2.0! Note to the Reader–Docs Being Revised for Selenium 2.0!  Introduction Test Automation for Web Applications IntroductionTest Automation for Web Applications  To Automate or Not to Automate? To Automate or Not to Automate?  Introducing Selenium Introducing Selenium  Brief History of The Selenium Project Brief History of The Selenium Project  Selenium’s Tool Suite Selenium’s Tool Suite  Choosing Your Selenium Tool Choosing Your Selenium Tool  Supported Browsers and Platforms Supported Browsers and Platforms  Flexibility and Extensibility Flexibility and Extensibility  What’s in this Book? What’s in this Book?  The Documentation Team–Authors Past and Present The Documentation Team–Authors Past and Present

Lec 18 Web with Selenium 17 CSCE 747 Fall 2013 Test Automation for Web Applications  test automation  specify input (events)  specify expected output  compare expected with actual output  advantages to test automation  repeatability of the tests and  the speed at which the tests can be executed  Selenium is possibly the most widely-used open source solution

Lec 18 Web with Selenium 18 CSCE 747 Fall 2013 Test automation supports:  Frequent regression testing  Rapid feedback to developers  Virtually unlimited iterations of test case execution  Support for Agile and extreme development methodologies  Disciplined documentation of test cases  Customized defect reporting  Finding defects missed by manual testing

Lec 18 Web with Selenium 19 CSCE 747 Fall 2013 To Automate or Not to Automate?  It is not always advantageous to automate test cases.  There are times when manual testing may be more appropriate.  For instance, if the application’s user interface will change considerably in the near future, then any automation might need to be rewritten anyway. Also,  sometimes there simply is not enough time to build test automation.  For the short term, manual testing may be more effective.  If an application has a very tight deadline, there is currently no test automation available, and it’s imperative that the testing get done within that time frame, then manual testing is the best solution.

Lec 18 Web with Selenium 20 CSCE 747 Fall 2013 Introducing Selenium  Selenium is a set of different software tools  Each with a different approach to supporting test automation.  The entire suite of tools results in a rich set of testing functions specifically geared to the needs of testing of web applications of all types.  These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.  One of Selenium’s key features is the support for executing one’s tests on multiple browser platforms.

Lec 18 Web with Selenium 21 CSCE 747 Fall 2013 Brief History of The Selenium Project  In 2004 Jason Huggins “better uses of his time than manually stepping through the same tests with every change he made. “  He developed a Javascript library that could drive interactions with the page, allowing him to automatically rerun tests against multiple browsers.  That library became Selenium Core, which underlies all the functionality of Selenium Remote Control (RC) and Selenium IDE.  Selenium RC was ground-breaking because no other product allowed you to control a browser from a language of your choice.

Lec 18 Web with Selenium 22 CSCE 747 Fall 2013 Web Driver  In 2006 Simon Stewart at Google started work on a project he called WebDriver.  Google had long been a heavy user of Selenium, but testers had to work around the limitations of the product.  Simon wanted a testing tool that spoke directly to the browser using the ‘native’ method for the browser and operating system,  thus avoiding the restrictions of a sandboxed Javascript environment.

Lec 18 Web with Selenium 23 CSCE 747 Fall 2013 Merging of Selenium and WebDriver  Selenium had massive community and commercial support, but WebDriver was clearly the tool of the future.  “Why are the projects merging? Partly because webdriver addresses some shortcomings in selenium (by being able to bypass the JS sandbox, for example. And we’ve got a gorgeous API), partly because selenium addresses some shortcomings in webdriver (such as supporting a broader range of browsers) and partly because the main selenium contributors and I felt that it was the best way to offer users the best possible framework.” from Simon Stewart

Lec 18 Web with Selenium 24 CSCE 747 Fall 2013 Selenium Suite  Selenium 2 aka. Selenium Webdriver  Selenium 1 aka. Selenium RC or Remote Control  Selenium IDE is a prototyping tool for building test scripts.  Selenium-Grid allows scaling for large test suites and for test suites that must be run in multiple environments

Lec 18 Web with Selenium 25 CSCE 747 Fall 2013 Selenium IDE  Selenium IDE is a prototyping tool for building test scripts.  a Firefox plugin and provides an easy-to-use interface for developing automated tests  Selenium IDE has a recording feature,  which records user actions as they are performed  and then exports them as a reusable script that can be later executed

Lec 18 Web with Selenium 26 CSCE 747 Fall 2013 Choosing Your Selenium Tool  Selenium-WebDriver API being the future direction for Selenium.  Selenium 1 is provided for backwards compatibility.  Still, both have strengths and weaknesses which are discussed in the corresponding chapters of this document.

Lec 18 Web with Selenium 27 CSCE 747 Fall 2013 Selenium-WebDriver  Selenium-WebDriver supports the following browsers along with the operating systems these browsers are compatible with.  Google Chrome  Internet Explorer 6, 7, 8, and 64-bit where applicable  Firefox 3.0, 3.5, 3.6, 4.0, 5.0, 6, 7  Opera  HtmlUnit 2.9  Android – 2.3+ for phones and tablets (devices & emulators)  iOS 3+ for phones (devices & emulators) and 3.2+ for tablets (devices & emulators)

Lec 18 Web with Selenium 28 CSCE 747 Fall 2013 Selenium-WebDriver  Selenium-WebDriver was developed to better support dynamic web pages where elements of a page may change without the page itself being reloaded.  WebDriver’s goal is to supply a well-designed object-oriented API that provides improved support for modern advanced web-app testing problems.

Lec 18 Web with Selenium 29 CSCE 747 Fall 2013 How Does WebDriver ‘Drive’ the Browser  Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation.  How these direct calls are made, and the features they support depends on the browser you are using.  This information is isolated in ‘browser drivers’

Lec 18 Web with Selenium 30 CSCE 747 Fall 2013 WebDriver and the Selenium-Server  There are some reasons though to use the Selenium-Server with Selenium-WebDriver. 1.You are using Selenium-Grid to distribute your tests over multiple machines or virtual machines (VMs). 2.You want to connect to a remote machine that has a particular browser version that is not on your current machine. 3.You are not using the Java bindings (i.e. Python, C#, or Ruby) and would like to use HtmlUnit DriverHtmlUnit Driver

Lec 18 Web with Selenium 31 CSCE 747 Fall 2013 Setting Up a Selenium-WebDriver Project for Java  to set up a Selenium 2.0 Java project is to use Maven.  Maven will download the java bindings (the Selenium 2.0 java client library) and all its dependencies, and  will create the project for you, using a maven pom.xml (project configuration) file.  Once you’ve done this, you can import the maven project into your preferred IDE, IntelliJ IDEA or Eclipse

Lec 18 Web with Selenium 32 CSCE 747 Fall

Lec 18 Web with Selenium 33 CSCE 747 Fall 2013 Selenium Testing Tools Cookbook by Gundecha – 2012