Test Automation For Web-Based Applications

Slides:



Advertisements
Similar presentations
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Advertisements

Intro to HTML. HTML HTML = HyperText Markup Language Used to define the content of a webpage HTML is made up of tags and attributes Content.
Introduction to HTML & CSS
Cascading Style Sheets CSS. What is it? Another file format ! its not like html Describes the looks of “selectors” in a.css file (example.css) in the.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 9: Defining Selectors.
CSW131 Steven Battilana 1 CSW 131 – Chapter 5 (More) Advanced CSS Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
 Pseudo-elements  Centering  Tables  Classes and ids.
 CSS ids  Pages  Sites  HTML: class=“name”  Names may define format OR content › Either works  CAN apply multiple classes to the same tag  Multiple.
HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
1 Test Automation For Web-Based Applications Selenium HP Web Test Tool Training Portnov Computer School.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
Css. Definition Cascading style sheet (CSS) Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
CSS Basic (cascading style sheets)
Meet the Document Tree Your roadmap to Web Design.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Advanced Selenium.  XPath is used to navigate through elements and attributes in a document.  XPath includes over 100 built-in functions.  Functions.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
INTRODUCTORY Tutorial 6 Using Links on a Web Page.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
1 © Netskills Quality Internet Training, University of Newcastle Using Style Sheets in Dreamweaver CS © Netskills, Quality Internet Training, University.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Introduction to CSS. Why CSS? CSS Provides Efficiency in Design and Updates CSS relatively easy to use Can give you more flexibility and control Faster.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
Tata Consultancy Services1 WebDriver Basics Submitted By : Akhil K Gagan Deep Singh Naveenrajha H M Poornachandra Meduri Shubham Utsav Sunil Kumar G Vivek.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Selective Formatting. Auto Grader Multiple selectors  May use the same formatting for two elements h1, h2 { font-family: cursive; }  Maintains consistency.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, Third Edition.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
CIS132 CSS Selectors 3 of 4 CSS3 selectors. CIS132 CSS Selectors Selectors define or style elements on the web page.Selectors define or style elements.
Mastering CSS Selectors in Selenium
Introduction to CSS: Selectors
Getting Started with CSS
Selenium HP Web Test Tool Training
Selenium HP Web Test Tool Training
Xpath creation.
Selenium HP Web Test Tool Training
>> Introduction to CSS
Selenium WebDriver Web Test Tool Training
Display Property.
CSCE 747 Software Testing and Quality Assurance
Intro to CSS CS 1150 Fall 2016.
Website Design 3
Intro to CSS CS 1150 Spring 2017.
Haden Jackson-Robbins
Test Automation For Web-Based Applications
IS 360 Understanding CSS Selectors
Test Automation For Web-Based Applications
Selenium HP Web Test Tool Training
Test Automation For Web-Based Applications
Document Object Model (DOM): Objects and Collections
Selenium WebDriver Web Test Tool Training
HTML What is it? HTML is a computer language devised to allow website creation. These websites can then be viewed by anyone else connected to the Internet.
Test Automation For Web-Based Applications
Training & Development
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
HTML / CSS Mai Moustafa Senior Web Designer eSpace eSpace.
Selenium HP Web Test Tool Training
Selenium HP Web Test Tool Training
Test Automation For Web-Based Applications
Build a Text Dataset from AMAZON
Presentation transcript:

Test Automation For Web-Based Applications Portnov Computer School WebDriver Training Test Automation For Web-Based Applications Presenter: Ellie Skobel

Day 3 Locating Elements

Locator Required parameter for webdriver commands find_element() find_elements() find_element_by_*() find_elements_by_*() and other selenium objects / methods Identifies an element in the content of the web application Consists of the location strategy followed by the location find_element_by_xpath(location)

Locator Categories Selenium WebDriver supports two main locator categories css_selector xpath For convenience a number of subcategories are also available id class_name name tag_name link_text partial_link_text

Choosing Locator Strategy If an element contains an id attribute – locating the element by id is preferred Faster execution Less susceptible to breakage due to changes within UI If an element contain a unique class attribute or a combination of unique attributes - locating the element by CSS is preferred Faster execution than XPath If an element must be located by its TEXT_NODE or its relationship to other elements – XPath must be utilized higher versatility

css=input.required.passfield Locating by CSS CSS selectors can be used by Selenium WebDriver to locate web elements To locate by css class attribute append the class name to the parent tag name using a period (.) To locate by css id attribute append the id name to the parent tag name using a pound character (#) To locate by any other attribute, include the attribute name and value in square brackets next to the parent tag name. css=form#loginForm css=input [name="username"] css=input.required.passfield [type=“password"]

Locating by CSS To explicitly document a parent – child relationship between two html tags use the more-then (>) character form>input[value="Login"] To document relative ancestral relationship between two tags use a single space body input[value="Clear"] CSS locator strategy cannot be used to locate tags that are before or above the current tag Including tag names is optional #loginForm .passfield

Locating by XPath XPath locator which begin with “//” are relative //input[@name='continue'][@type='button'] //body/form/input[4] XPath locator which begin with “.//” are relative to the current WebElement It is possible to locate parent WebElements with XPath using "/.." //input[@name='password']/..

Locating by Text with XPath <table id="btnTable"> <tr class="row"> <td><label>Apples</label></td> <td><input/></td> <td><label>Oranges</label></td> </table> Web elements can be located by exact text using the text( ) command //label[text()="Oranges"] It is also possible to locate web elements by partial text using the contains( ) command //label[contains(text(),"ange"] Additionally contains( ) command can also be used to locate web elements by partial value of any attribute //tr[contains(@class, "ow")]

References CSS: http://www.w3.org/TR/css3-selectors/ Xpath http://www.w3schools.com/Xpath/ http://www.w3.org/TR/xpath Also PDF and PDF