And the PageObject Design Model.  How Selenium Remote Control works  You launch a server on your test machine.  Your tests connect to that server via.

Slides:



Advertisements
Similar presentations
A Bluffer's Guide to Selenium 2 By: Simon Stewart & Anthony Long.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Selenium Tutorial. What is Selenium? Javascript framework that runs in your web- browser Works anywhere Javascript is supported Hooks for many other languages.
Selenium Automation Testing Suite of Tools
Written by: Dr. JJ Shepherd
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
Object Oriented Programming (OOP) LAB # 5 TA. Maram & TA. Mubaraka TA. Kholood & TA. Aamal.
4/25/ Application Server Issues for the Project CSEP 545 Transaction Processing for E-Commerce Philip A. Bernstein Copyright ©2003 Philip A. Bernstein.
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
Ch. 31 Q and A IS 333 Spring 2015 Victor Norman. SNMP, MIBs, and ASN.1 SNMP defines the protocol used to send requests and get responses. MIBs are like.
Selenium Automation Testing Suite of Tools. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for.
Automation using Selenium Authored & Presented by : Chinmay Sathe & Amit Prabhu Cybage Software Pvt. Ltd.
UNIT-V The MVC architecture and Struts Framework.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Javascript and the Web Whys and Hows of Javascript.
User Extensions, RC and Web Driver Anton Angelov QA Engineer SystemIntegrationTeam Telerik QA Academy Telerik QA Academy.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
Val Kravets, Luis Sanchez, Allen Chung, Phillip Anderson, Leyla Norooz, Brian Ramnarian, Todd Watson.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
Software Architecture for ColdFusion Developers Unit 4: Application Events and Global Variables.
Developing Better PhoneGap Apps Session 608 / DevLearn 2013 Daniel Pfeiffer Lead Developer / Float Mobile Learning.
1 JavaScript. 2 What’s wrong with JavaScript? A very powerful language, yet –Often hated –Browser inconsistencies –Misunderstood –Developers find it painful.
Lecture 16 Page 1 CS 236 Online SQL Injection Attacks Many web servers have backing databases –Much of their information stored in a database Web pages.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
Tutorial 2 Variables and Objects. Working with Variables and Objects Variables (or identifiers) –Values stored in computer memory locations –Value can.
SE-2840 Dr. Mark L. Hornick 1 Modifying webpage behavior using client-side scripting Javascript.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Exceptions Handling Exceptionally Sticky Problems.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 15: More-Advanced Concepts.
23-Oct-15 Abstract Data Types. 2 Data types A data type is characterized by: a set of values a data representation, which is common to all these values,
Web Automation Testing With Selenium By Rajesh Kanade.
Automated Smoke Testing on the JVM with Geb João SILVA (GS-AIS-EB) 1st Forum 29th of September, 2015 e-Business Section AUTOMATED SMOKE.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Lec 19 Web Driver 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 19 Selenium Web Driver 11/4/
Mohit Anand, Software Engineer Adobe 1 Selecting GUI Automation Testing Tool for Mobile Domain.
WEB SERVER SOFTWARE FEATURE SETS
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Written by: Dr. JJ Shepherd
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Test Java EE applications with Arquillian Ivan St. Ivanov.
Ch. 31 Q and A IS 333 Spring 2016 Victor Norman. SNMP, MIBs, and ASN.1 SNMP defines the protocol used to send requests and get responses. MIBs are like.
Monitoring Dynamic IOC Installations Using the alive Record Dohn Arms Beamline Controls & Data Acquisition Group Advanced Photon Source.
Thomas Burleson. Using MVC with Flex & Coldfusion Projects June 27, 2007 See how Coldfusion MVC is similar to Flex MVC…
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Selenium HP Web Test Tool Training
Stable and reliable Web Automation
Handling Exceptionally Sticky Problems
Automated UI Testing with Seleno.
UI Test Automation with Appium
Testing Your Alfresco Add-ons
SQL Injection Attacks Many web servers have backing databases
Haden Jackson-Robbins
JavaScript Introduction
JavaScript an introduction.
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Digital Instinct - Selenium Monkey Test Analyst By David Williams
Code Composer Essentials 3.0
Handling Exceptionally Sticky Problems
Lecture 34: Testing II April 24, 2017 Selenium testing script 7/7/2019
[Robert W. Sebesta, “Programming the World Wide Web
APPLET PROGRAMMING.
Intro to Programming (in JavaScript)
Presentation transcript:

and the PageObject Design Model

 How Selenium Remote Control works  You launch a server on your test machine.  Your tests connect to that server via IP.  The server launches a browser, with selenium CORE embedded as javascript into the page.  Selenium CORE simulates user actions with javascript.

THE GOOD THE BAD  Doesn’t steal your mouse/keyboard.  Works with any browser that uses javascript  Works for any OS that supports java.  Very fast page interactions.  Large API  Supports a variety of programming languages.  Can be run on remote machines  Can’t see anything outside the page object.  Not all browsers support all functionality.  Some pages aren’t automatable.  Can’t see inside third party apps  XSS Limitations

 A different way of automating the browser.  Create a browser-specific driver to control the browser directly.  Have to do this for each browser!  Object oriented API  Doesn’t need a real browser  No javascript limitations  No need for a server.  Isn’t as delicate as selenium.

 Went into Beta Dec 24 th.  WebDriver + Selenium  The two projects have merged (literally) into Selenium 2.0  Large browser support and no javascript limitations.  No server  The old API’s are still available.  New API’s are becoming available.

 You have 2 options:  IWebDriver  This is just the WebDriver api  Doesn’t support a lot of browsers.  Will need to change all your tests.  WebDriverBackedSelenium  Uses the old Selenium 1 API  But uses WebDriver to run things if possible  Can use selenium 1 if the browser isn’t supported.

 Object Oriented  Doesn’t break nearly as often  Handles pageloads automatically  Fewer problems automating  Somewhat more complicated API  selenium.type(“password”,”thisIsMyPassword”);  driver.findElement(By.id("password")).sendKeys(“thisIsMyPassword");  By.Id, By.Xpath, By.Name, By.ClassName, By.PartialLinkText  All the supported browsers work really well  Can extend the API to add custom functionality.  Works well with a Page Object design model.

 Adds a layer of abstraction into your code.  Helps to organize your code once it grows large.  All automation is automatically reusable and shareable.  A way to separate tests from re-usable functions.  A way to store information about how the system works.  A way to specify what page functions start on, and what page they end on.  A way to programmatically break your tests when functionality changes.  Makes code maintenance easier.  There is even a PageFactory class available to automatically create them.

 Each page is defined as it’s own class.  Actions (including navigation) are represented as functions for a class.  Each function returns a new Page object, signifying what page the actions stops on.  Your tests “know” what page you are on, and will only give you access to functions available to that class.  Tests only talk to the page objects.  Page objects only talk to the driver.  Elements on the page are stored as variables for the page object.  Automatic page validations can be stored in the constructor for each page object.  Tests become a string of well defined functions, not meaningless gibberish.  Tests can be grouped by namespace.  Class Inheritance can be used to define functionality to a set of pages.  We can make functional logic transparent to the tests by returning different inherited classes.

globalVars.logDescription = "log in"; globalVars.selenium.Open(globalVars.mobiUrl); functions.type("userId", globalVars.studName + "1"); functions.type("password", globalVars.studPass + "1"); functions.clickAndWait("signInBtn"); globalVars.logDescription = "Checking elements on happenings:by date page"; selenium.click("backButton"); selenium.click("backButton"); globalVars.selenium.Select("byDateFilter", "label=Things Happening Soon"); selenium.click("backButton"); globalVars.selenium.Select("byDateFilter", "label=Things That Happened");

[Test] public void testByDateTab() { funtions.loginMobi(); functions.verifyThingsToKnow(); functions.verifyThingsHappeningSoon(); selenium.Select("byDateFilter", "label=Things That Happened"); functions.verifyThingsThatHappened(); }

[Test] public void testByDateTab() { selenium.Open(Moby_Common.MobyLoginUrl); LoginPage loginPage = new LoginPage(selenium); HappeningsPage happeningsPage = loginPage.loginAs(Common.stud1Name, Common.stud1Password); happeningsPage.waitToLoad(); Assert.That(!happeningsPage.isByTypePageLoaded()); Assert.That(happeningsPage.isByDatePageLoaded()); Assert.That(!happeningsPage.isByCoursePageLoaded()); happeningsPage.filterResults("byDateFilter","Things That Happened"); Assert.That(happeningsPage.isVisible("TTHContainer")); happeningsPage.filterResults("byDateFilter", "Things Happening Soon"); Assert.That(happeningsPage.isVisible("THSContainer")); happeningsPage.filterResults("byDateFilter", "All Types"); Assert.That(happeningsPage.isVisible("TTHContainer")); Assert.That(happeningsPage.isVisible("THSContainer")); }

public class HappeningsPage : WebPageBaseClass { private string _loadingImage = private string _moreLink = "more"; public HappeningsPage(ISelenium selenium) { this.selenium = selenium; this.title = "Happenings"; this.url = "index.html"; assertPageLoadedCorrectly(); } public HappeningsPage waitToLoad() { waitForElementNotVisible(_loadingImage ); return new HappeningsPage(selenium); } public ContentItemPage goToItem(string type, string name) { + type + "']//span[text()=\"" + name + "\"]"); return new ContentItemPage(selenium); } public HappeningsPage clickMoreLink() { click(_moreLink); return new HappeningsPage(selenium); } public HappeningsPage filterResults(string id, string name) { selectDropdown(id, name); return new HappeningsPage(selenium); }