Advanced Objects. Agenda 2 Working with Websites & Applications ScriptOnce Helpful XPath Tips.

Slides:



Advertisements
Similar presentations
Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C2.
Advertisements

Introduction to HTML & CSS
Dr. Alexandra I. Cristea XPath and Namespaces.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 9: Defining Selectors.
XPath Eugenia Fernandez IUPUI. XML Path Language (XPath) a data model for representing an XML document as an abstract node tree a mechanism for addressing.
2-Jun-15 XPath. 2 What is XPath? XPath is a syntax used for selecting parts of an XML document The way XPath describes paths to elements is similar to.
Lecture 13. The various node tests also work on this axis: eg node() This book has descendant-or- self nodes As expected, text nodes are included in the.
Lecture 13. The various node tests also work on this axis: eg node() This book has descendant-or- self nodes As expected, text nodes are included in the.
XSL Transformations Lecture 8, 07/08/02. Templates The whole element is a template The match pattern determines where this template applies Result element(s)
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Lecture 12. Default Processing in XSLT The default processing in XSLT is to process the XPath root node The default processing for various node types.
Leveraging Objects with XPath
Developing Content for Mobile Devices Larry D. Lee Web Developer for K4Health.
SD2520 Databases using XML and JQuery
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
Chapter 4 Web Pages Using Web Standards Chapter 3 XML – the ‘X’ in Ajax.
Looking Good Online Design and Presentation of Websites 1.
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
Review: How do you change the border color of an image?
1/17 ITApplications XML Module Session 7: Introduction to XPath.
XSLT and XPath, by Dr. Khalil1 XSL, XSLT and XPath Dr. Awad Khalil Computer Science Department AUC.
1 Dr Alexiei Dingli XML Technologies X-Languages.
Lecture 2 : Understanding the Document Object Model (DOM) UFCFR Advanced Topics in Web Development II 2014/15 SHAPE Hong Kong.
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
Lecture 11 – DOM Scripting SFDV3011 – Advanced Web Development Reference: 1.
JavaScript – The DOM JavaScript is object based The browser is object based – We can access the browser's objects in the same way we did JavaScript's Two.
XPath Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
SDPL 2001Notes 4: Intro to Stylesheets1 4. Introduction to Stylesheets n Discussed recently: –Programmatic manipulation of (data-oriented) documents n.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
Li Tak Sing COMPS311F. XPath XPath is a simple language that allows you to write expressions to refer to different parts of an XML document. We will learn.
1 Displaying XML Document Web and Database Management System.
August Chapter 6 - XPath & XPointer Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
Database Systems Part VII: XML Querying Software School of Hunan University
Advanced Selenium.  XPath is used to navigate through elements and attributes in a document.  XPath includes over 100 built-in functions.  Functions.
XSLT Streaming Terminology Understanding “Climbing” Roger L. Costello January 29, 2014.
XPath Presented by Kushan Athukorala. 2 Agenda XPath XPath Terminology Selecting Nodes Predicates.
How the Web Works Building a Website – Lesson 1. How People Access the Web Browsers People access websites using software called a web browser. To view.
1 XML Data Management Extracting Data from XML: XPath Werner Nutt based on slides by Sara Cohen, Jerusalem.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
1 XML Data Management XPath Principles Werner Nutt.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Neal Stublen New Element Styling  html5shiv.js provided support in older IE browsers for new sectioning elements aside, header,
SDPL 2002Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human-oriented.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® REUSABLE DESIGN.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
DOM (Document Object Model) - Parsing and Reading HTML and XML -
Data Structures Lakshmish Ramaswamy. Tree Hierarchical data structure Several real-world systems have hierarchical concepts –Physical and biological systems.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
Grouping Robin Burke ECT 360. Outline Extra credit Numbering, revisited Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method.
Grouping Robin Burke ECT 360. Outline Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method Generated ids Keys Moded Templates.
Document Object Model (DOM). Outline  Introduction of DOM  Overview of DOM  DOM Relationships  Standard DOM.
SDPL 2004Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
1 The XPath Language. 2 XPath Expressions Flexible notation for navigating around trees A basic technology that is widely used uniqueness and scope in.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
© 2013 The MITRE Corporation. All rights reserved. XSLT Streaming Terminology Understanding “Climbing” Roger L. Costello, February 3, 2014.
XML DOM Week 11 Web site:
CITA 330 Section 5 XPath. XSL XSL (Extensible Stylesheet Language) is the standard language for writing stylesheets to transform XML documents among different.
XML Query languages--XPath. Objectives Understand XPath, and be able to use XPath expressions to find fragments of an XML document Understand tree patterns,
Internet & World Wide Web How to Program, 5/e 1. 2.
THE DOM.
DHTML.
CGS 3066: Web Programming and Design Spring 2017
Document Object Model (DOM): Objects and Collections
Week 11 Web site: XML DOM Week 11 Web site:
Tutorial 6 Creating Dynamic Pages
Lecture 36 Section 12.2 Mon, Apr 23, 2007
Presentation transcript:

Advanced Objects

Agenda 2 Working with Websites & Applications ScriptOnce Helpful XPath Tips

Applications & Websites 3 A Website is usually a single site that devices from all platforms access equally –Websites use different CSS to adapt to different screens and some use responsive design to change layout dynamically –It should be possible to be script once, check that CSS tags are indeed identical –Try out the site on a tablet, phablet and phone from more than one platform to get a feel before coding

Applications & Websites 4 Applications are different from each other –Developed by two different teams; and even though they may attempt to make the apps look the same, this is not their top priority. –Check if the id’s and object tree have enough in common, reach out to the Development team and try to adopt common conventions to enable one object level script.

Tips – Using Text 5 Using Text as Anchor –Use functions like "starts-with", "contains" when using the text property. – //*[starts-with(text(),"Perfe")] //button[contains(text(),"fecto")] –This will make the script more robust for small changes

Tips – ScriptOnce 6 Script Once despite occasionally being unable to find identical objects across platforms –When the applications are “close enough” the ability to say “this or that” every once in a while allows staying with one script. –

Tips – Hierarchy 7 Use Axes, such as "preceding-sibling", when your object does not have a unique property but another object that is close does. If your textfield is near a text with the label "Password", use //textfield[preceding-

Reference – XPath hierarchy 8 Axis NameResult ancestorSelects all ancestors (parent, grandparent, etc.) of the current node ancestor-or-selfSelects all ancestors (parent, grandparent, etc.) of the current node and the current node itself attributeSelects all attributes of the current node childSelects all children of the current node descendantSelects all descendants (children, grandchildren, etc.) of the current node descendant-or-selfSelects all descendants (children, grandchildren, etc.) of the current node and the current node itself followingSelects everything in the document after the closing tag of the current node following-siblingSelects all siblings after the current node namespaceSelects all namespace nodes of the current node parentSelects the parent of the current node precedingSelects all nodes that appear before the current node in the document, except ancestors, attribute nodes and namespace nodes preceding-siblingSelects all siblings before the current node selfSelects the current node

Tips - Indexes 9 We aim to identify the object regardless of “where it is” i.e. without an index –instead of //group[2]/textfield[1] use //group/textfield Sometimes, there is no unique property / unique tag. –Use indexes to create the shortest XPath when Instead of //device/view/group[1]/group[2]/textfiel d[1] use //group[2]/textfield[1]

Thank You