SlideShare a Scribd company logo
1 of 27
Object Spy, Visual Analysis and
XML/Xpath
Intro and Demo for Partners
David Broerman
Partner Enablement Manager
Email:
davidb@perfectomobile.com
Agenda
• Intro to Perfecto
• XML and Xpath and Objects
• What are XML and Xpath?
• Working with XML and Xpath
• Object Analysis and the Perfecto Object Spy
• What is Visual Analysis
• Best Practices with Perfecto
• Demo
Perfecto Automation
• Discuss Object Spy , Visual and Xpath
Review a Perfecto Lab Selenium/Appium Project in Eclipse
• Discuss Object Spy , Visual and Xpath
• Q&A
Intro to Perfecto
Perfecto Offers:
A Cloud Based Continuous Quality Lab
enabling testing and monitoring of all digital
platforms on real devices and real end user
conditions,
for enterprises adopting agile delivery processes.
3/28/2017 3
Intro to Perfecto
Dominant leader &
visionary
Strong
Ecosystem
Perfecto @ a glance
Working with Enterprises and Partners to deliver
exceptional digital experiences.
4
Setting the bar for
market success
• Founded in late 2006, Business HQ in Boston
• Over 300 employees globally
• Fortune 500 customer base
3/28/2017
“Perfecto Mobile
marks shift in mobile
apps quality with
Continuous Quality
Lab”
Cloud Based Quality Platform For The Digital Era
3/28/2017 5© 2017, Perfecto Mobile Ltd. All Rights Reserved.
Open & Integrated
into Dev/Test/Ops
Any test tool
Any CI server
Any test framework
Any IDE
Any Location
Code/Debug
Functional
Test
Performance
Test
Production
Insight
One Lab for all Digital Platforms
Reporting & Analytics
Wind Tunnel Layer
Customer
Support
Browsers Desktops Mobile Devices IoT
Open and Integrated
6
Open &
Integrated
Xcode
Selenium
3/28/2017
What are XML and Xpath?
• XML
• EXtensible Markup Language
• XML enables you to create data that can read by any application on any
platform
• Native Object analysis relies on XML
• The Object Tree is an XML document
• Xpath (XML Path Language)
• XPath is the query language for XML documents
• Describes a way to locate and process items in XML documents
• In automation, Xpath allows us to identify the object/objects
Importance of Understanding XML and XPath
8
• Native Object analysis relies on XML
• Retrieves the XML document and analyzes it
• However, it this is not enough to identify the object using its location in the
object tree. This approach is fragile.
• It is necessary to use specific XPath expressions to uniquely identify the
object.
• This will enable your object to be found across multiple platforms and
devices.
Native Objects Analysis
9
• The Object Tree is an XML document
• The way to find elements inside XML is through XPath
• To properly work with Objects, a good grasp of XML/XPath is needed.
The Perfecto Approach for Mobile
Objects
Native Object Analysis
and
Visual Object Analysis
=
HYBRID APPROACH!
Best Practice: Use Native Object
Analysis for Navigating and
Visual/OCR for Validation.
Pros
Cons
The Object Spy enables working with objects
• The Object Spy accesses the XML of the application
• Identifies the element and writes an XPath Expression.
• May need to export the XML into Firebug/FirePath.
• Inserts the expression back into the Object Spy.
• Applies the required action:
• Click – click on the element
• Set – an edit field with a value
• Info – to retrieve an element to receive its properties
• Find – find an element
Website & Apps – Object Trees/Identifying Objects
• Web Objects
• DOM
• Same Tree (PM or Appium
Framework)
• Native App Objects
• PM or Appium framework
• Appium -Separate naming
for Android and iOS
• Perfecto – Script Once
• Hybrid Application
• PM automation framework
• Mix of Native and DOM
objects
DOM Perfecto
Mobile
Appium
Working with the Object Spy
Selected Automation Function and Parameter fields
Object
XPath
Object TreePreview Panel
Search
and
Export
Filter displayed Objects
Object
Properties
Automation
functions
associated with
the selected
object type
Adding Commands from the Object
Spy
Working with Firebug and FirePath
15
Object Spy: Object Locator
Available –
• Object
Locator is availabl
e for Native, Web
and Hybrid apps.
• Easily generate
accurate XPath
identifiers from
within the
Perfecto Object
Spy
• Don’t have to
export to XML
and use tools
such as FireBug
and FirePath.
Visual Analysis
• Visual analysis is an alternative way of interacting with a device.
• Its’ source is the screenshot taken from the device (what the user sees).
• Perfecto can analyze the screenshot looking for either text or
images, with text being the recommended option.
Best Practice: Use Native Object
Analysis for Navigating and Visual for Validation.
Visual - Available Commands
• Select - Clicks on the image/text
• Find – Finds an image/text for visual
relationship
• Check – A Checkpoint that validates the
text/image appears on the screen
• (Sync is same command , Sync has a default
timeout of 60 seconds and check does not)
• Button – Clicks a Button
• Edit - Sets a value inside an input field
3/28/2017 18© 2015, Perfecto Mobile Ltd. All Rights Reserved.
Example - Coding Visual Analysis –
Java
• Visual Analysis –
Perfecto
Proprietary
command
executed using
RemoteWebDriver
• Use the
executeScript
method
• The script
parameter
contains the
command name,
in the following
format:
mobile:command
:subcommand.3/28/2017 19© 2015, Perfecto Mobile Ltd. All Rights Reserved.
Map<String, Object> params3 = new HashMap<>();
// Check for the text that indicates that the sign in
was successful
params3.put("content", "Welcome back John");
// allow up-to 30 seconds for the page to display
params3.put("timeout", "30");
resultString = (String)
driver.executeScript("mobile:checkpoint:text",
params3);
if (!resultString.equalsIgnoreCase("true")) {
System.out.println("'Welcome back John' text not
found");
}
Did You Know?
• When talking with users of the Perfecto Solution
• Approximately 90% of testing defects are found using Visual
Validation!
• Mobile is different as we want to understand the UX
• Need to see what the user sees
• An object on the screen may be found, but it may be hidden
behind something else (need visual validation).
XPath Examples
Example of Power of Xpath with Objects
22
Let's say that we want to work on a username field.
Remember:
 The default path generated by the Object Spy refers to its location; its placement on the
page.
 The placement of that object can change, or be slightly different in another platform
(i.e. tablet vs. smartphone).
 So, it's important to refer to it by its logical function instead of an arbitrary placement on
the page.
XPath will allow this to be specified: //[@username]
 This expression explicitly refers to the input field called 'username'.
Advantages:
 It is easy to read.
 It is likely to work well with minimal maintenance.
 It is likely to be identical across devices and platforms.
XPath Expression Syntax
23
Expression Description
nodename Selects all nodes with the name "nodename"
// Selects nodes in the document from the current node that match
the selection no matter where they are
//vehicle Selects all vehicle elements no matter where they are in the
document
//@make Selects all attributes named make
//*[@make="Toyota"] Select all attributes named make with value of Toyota
//vehicle[@*] Selects all vehicle elements which have any attribute
//*[text()=’Corolla’] Select all objects with the text Corolla
//vehicle[2] Select the second vehicle element
Demo
• Open Perfecto Automation and also Open existing Perfecto Lab
Selenium/Appium Project in Eclipse
• Discuss Object Spy , Visual Analysis and Xpath
Resources
• Sample script and Demo Apps
• https://community.perfectomobile.com/series/25427/posts/1064930
• Working with Object Spy and XPath
• https://community.perfectomobile.com/posts/914140-web-objects
• XPath Tutorial
• http://www.w3schools.com/XPath/
• XML Tutorial
• http://www.w3schools.com/xml/
Q&A
Thank You
David Broerman
Partner Enablement Manager
Email: davidb@perfectomobile.com

More Related Content

What's hot

Testing Your Software Testers
Testing Your Software TestersTesting Your Software Testers
Testing Your Software TestersOri Bendet
 
Testing NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFTTesting NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFTOri Bendet
 
Launch Better Apps, Faster - Perfecto & Orasi Joint Webinar Sldies
Launch Better Apps, Faster - Perfecto & Orasi Joint Webinar SldiesLaunch Better Apps, Faster - Perfecto & Orasi Joint Webinar Sldies
Launch Better Apps, Faster - Perfecto & Orasi Joint Webinar SldiesPerfecto by Perforce
 
Ady beleanu automate-theprocessdelivery
Ady beleanu   automate-theprocessdeliveryAdy beleanu   automate-theprocessdelivery
Ady beleanu automate-theprocessdeliveryRomania Testing
 
Mobile test automation perfecto star east
Mobile test automation perfecto star eastMobile test automation perfecto star east
Mobile test automation perfecto star eastPerfecto Mobile
 
How To Sell Into Insurance with Perfecto
How To Sell Into Insurance with PerfectoHow To Sell Into Insurance with Perfecto
How To Sell Into Insurance with PerfectoLizzy Guido (she/her)
 
What's New with Perfecto? - Mid-Year Edition
What's New with Perfecto? - Mid-Year EditionWhat's New with Perfecto? - Mid-Year Edition
What's New with Perfecto? - Mid-Year EditionLizzy Guido (she/her)
 
Augmented Reality & Software Testing - Sourabh d
Augmented Reality & Software Testing - Sourabh dAugmented Reality & Software Testing - Sourabh d
Augmented Reality & Software Testing - Sourabh dAgile Testing Alliance
 
Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud
Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud
Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud Applitools
 
Hp perfecto webinar - UFT Mobile
Hp perfecto webinar - UFT MobileHp perfecto webinar - UFT Mobile
Hp perfecto webinar - UFT MobilePerfecto Mobile
 
Test Automation for Mobile Applications: A Practical Guide
Test Automation for Mobile Applications: A Practical GuideTest Automation for Mobile Applications: A Practical Guide
Test Automation for Mobile Applications: A Practical GuideTechWell
 
Mobile Testing Service Desk_Own.ppt
Mobile Testing Service Desk_Own.pptMobile Testing Service Desk_Own.ppt
Mobile Testing Service Desk_Own.pptQA Programmer
 
Roland van leusden mobile performance testing rtc 2014 v0.6
Roland van leusden   mobile performance testing  rtc 2014 v0.6Roland van leusden   mobile performance testing  rtc 2014 v0.6
Roland van leusden mobile performance testing rtc 2014 v0.6Romania Testing
 
kalyanasundaram,sripriya_tcoepresentation
kalyanasundaram,sripriya_tcoepresentationkalyanasundaram,sripriya_tcoepresentation
kalyanasundaram,sripriya_tcoepresentationQA Programmer
 
Implementing DevOps at Scale Using Dynamic Environments
Implementing DevOps at Scale Using Dynamic EnvironmentsImplementing DevOps at Scale Using Dynamic Environments
Implementing DevOps at Scale Using Dynamic EnvironmentsSauce Labs
 
Testing Solutions for Hyper Connected Apps by Sivakumar Anna
Testing Solutions for Hyper Connected Apps by Sivakumar AnnaTesting Solutions for Hyper Connected Apps by Sivakumar Anna
Testing Solutions for Hyper Connected Apps by Sivakumar AnnaQA or the Highway
 
Continuous delivery mobile application development
Continuous delivery mobile application developmentContinuous delivery mobile application development
Continuous delivery mobile application developmentThoughtworks
 

What's hot (20)

Testing Your Software Testers
Testing Your Software TestersTesting Your Software Testers
Testing Your Software Testers
 
Mobile Monitoring Best Practices
Mobile Monitoring Best PracticesMobile Monitoring Best Practices
Mobile Monitoring Best Practices
 
Testing NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFTTesting NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFT
 
Launch Better Apps, Faster - Perfecto & Orasi Joint Webinar Sldies
Launch Better Apps, Faster - Perfecto & Orasi Joint Webinar SldiesLaunch Better Apps, Faster - Perfecto & Orasi Joint Webinar Sldies
Launch Better Apps, Faster - Perfecto & Orasi Joint Webinar Sldies
 
Ady beleanu automate-theprocessdelivery
Ady beleanu   automate-theprocessdeliveryAdy beleanu   automate-theprocessdelivery
Ady beleanu automate-theprocessdelivery
 
Mobile test automation perfecto star east
Mobile test automation perfecto star eastMobile test automation perfecto star east
Mobile test automation perfecto star east
 
How To Sell Into Insurance with Perfecto
How To Sell Into Insurance with PerfectoHow To Sell Into Insurance with Perfecto
How To Sell Into Insurance with Perfecto
 
What's New with Perfecto? - Mid-Year Edition
What's New with Perfecto? - Mid-Year EditionWhat's New with Perfecto? - Mid-Year Edition
What's New with Perfecto? - Mid-Year Edition
 
Augmented Reality & Software Testing - Sourabh d
Augmented Reality & Software Testing - Sourabh dAugmented Reality & Software Testing - Sourabh d
Augmented Reality & Software Testing - Sourabh d
 
Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud
Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud
Testdroid: Release Perfect Apps with Mobile Visual Testing in the Cloud
 
Hp perfecto webinar - UFT Mobile
Hp perfecto webinar - UFT MobileHp perfecto webinar - UFT Mobile
Hp perfecto webinar - UFT Mobile
 
Test Automation for Mobile Applications: A Practical Guide
Test Automation for Mobile Applications: A Practical GuideTest Automation for Mobile Applications: A Practical Guide
Test Automation for Mobile Applications: A Practical Guide
 
Mobile Testing Service Desk_Own.ppt
Mobile Testing Service Desk_Own.pptMobile Testing Service Desk_Own.ppt
Mobile Testing Service Desk_Own.ppt
 
Roland van leusden mobile performance testing rtc 2014 v0.6
Roland van leusden   mobile performance testing  rtc 2014 v0.6Roland van leusden   mobile performance testing  rtc 2014 v0.6
Roland van leusden mobile performance testing rtc 2014 v0.6
 
Juc oct 2014 final
Juc oct 2014 finalJuc oct 2014 final
Juc oct 2014 final
 
Mobile App Testing Best Practices
Mobile App Testing Best PracticesMobile App Testing Best Practices
Mobile App Testing Best Practices
 
kalyanasundaram,sripriya_tcoepresentation
kalyanasundaram,sripriya_tcoepresentationkalyanasundaram,sripriya_tcoepresentation
kalyanasundaram,sripriya_tcoepresentation
 
Implementing DevOps at Scale Using Dynamic Environments
Implementing DevOps at Scale Using Dynamic EnvironmentsImplementing DevOps at Scale Using Dynamic Environments
Implementing DevOps at Scale Using Dynamic Environments
 
Testing Solutions for Hyper Connected Apps by Sivakumar Anna
Testing Solutions for Hyper Connected Apps by Sivakumar AnnaTesting Solutions for Hyper Connected Apps by Sivakumar Anna
Testing Solutions for Hyper Connected Apps by Sivakumar Anna
 
Continuous delivery mobile application development
Continuous delivery mobile application developmentContinuous delivery mobile application development
Continuous delivery mobile application development
 

Similar to TechTalk: Advanced Practices for Visual Test Automation

TechTalk: Taking the Mystery Out of Object ID Automation
TechTalk: Taking the Mystery Out of Object ID AutomationTechTalk: Taking the Mystery Out of Object ID Automation
TechTalk: Taking the Mystery Out of Object ID AutomationLizzy Guido (she/her)
 
CS02A - Interacting with applications.pptx
CS02A - Interacting with applications.pptxCS02A - Interacting with applications.pptx
CS02A - Interacting with applications.pptxAnand722237
 
Proxy Design Patterns
Proxy Design PatternsProxy Design Patterns
Proxy Design PatternsZafer Genc
 
Sps Oslo - Introduce redux in your sp fx solution
Sps Oslo - Introduce redux in your sp fx solutionSps Oslo - Introduce redux in your sp fx solution
Sps Oslo - Introduce redux in your sp fx solutionYannick Borghmans
 
Project_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxProject_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxskhushi9980
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps QuicklyGil Irizarry
 
Knolidge - Discover What You Have
Knolidge - Discover What You HaveKnolidge - Discover What You Have
Knolidge - Discover What You Haveknolidge
 
Ef Poco And Unit Testing
Ef Poco And Unit TestingEf Poco And Unit Testing
Ef Poco And Unit TestingJames Phillips
 
Interview qutions
Interview qutionsInterview qutions
Interview qutionssatyaragha
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperFabrit Global
 
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshopKetan Soni
 
iPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday AhmedabadiPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday Ahmedabadmomoahmedabad
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09Pyxis Technologies
 
Develop a portal to manage your IoT Hub solution
 Develop a portal to manage your IoT Hub solution Develop a portal to manage your IoT Hub solution
Develop a portal to manage your IoT Hub solutionMarco Parenzan
 
QTP Interview Questions and answers
QTP Interview Questions and answersQTP Interview Questions and answers
QTP Interview Questions and answersRita Singh
 
JMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialJMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialRyan Baxter
 

Similar to TechTalk: Advanced Practices for Visual Test Automation (20)

TechTalk: Taking the Mystery Out of Object ID Automation
TechTalk: Taking the Mystery Out of Object ID AutomationTechTalk: Taking the Mystery Out of Object ID Automation
TechTalk: Taking the Mystery Out of Object ID Automation
 
CS02A - Interacting with applications.pptx
CS02A - Interacting with applications.pptxCS02A - Interacting with applications.pptx
CS02A - Interacting with applications.pptx
 
Proxy Design Patterns
Proxy Design PatternsProxy Design Patterns
Proxy Design Patterns
 
The Developers World
The Developers WorldThe Developers World
The Developers World
 
Sps Oslo - Introduce redux in your sp fx solution
Sps Oslo - Introduce redux in your sp fx solutionSps Oslo - Introduce redux in your sp fx solution
Sps Oslo - Introduce redux in your sp fx solution
 
Project_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxProject_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptx
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps Quickly
 
Knolidge - Discover What You Have
Knolidge - Discover What You HaveKnolidge - Discover What You Have
Knolidge - Discover What You Have
 
Ef Poco And Unit Testing
Ef Poco And Unit TestingEf Poco And Unit Testing
Ef Poco And Unit Testing
 
Interview qutions
Interview qutionsInterview qutions
Interview qutions
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshop
 
iPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday AhmedabadiPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday Ahmedabad
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Splunk Developer Platform
Splunk Developer PlatformSplunk Developer Platform
Splunk Developer Platform
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09
 
Develop a portal to manage your IoT Hub solution
 Develop a portal to manage your IoT Hub solution Develop a portal to manage your IoT Hub solution
Develop a portal to manage your IoT Hub solution
 
QTP Interview Questions and answers
QTP Interview Questions and answersQTP Interview Questions and answers
QTP Interview Questions and answers
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
JMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialJMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocial
 

More from Lizzy Guido (she/her)

What's New with Perfecto? - June 2017
What's New with Perfecto? - June 2017What's New with Perfecto? - June 2017
What's New with Perfecto? - June 2017Lizzy Guido (she/her)
 
What's New with Perfecto? - May 2017
What's New with Perfecto? - May 2017What's New with Perfecto? - May 2017
What's New with Perfecto? - May 2017Lizzy Guido (she/her)
 
What's New with Perfecto? - April 2017
What's New with Perfecto? - April 2017What's New with Perfecto? - April 2017
What's New with Perfecto? - April 2017Lizzy Guido (she/her)
 
TechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UXTechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UXLizzy Guido (she/her)
 
TechTalk: Everything You Need to Know about Appium & Selenium
TechTalk: Everything You Need to Know about Appium & SeleniumTechTalk: Everything You Need to Know about Appium & Selenium
TechTalk: Everything You Need to Know about Appium & SeleniumLizzy Guido (she/her)
 
Everything You Need To Know about Appium and Selenium
Everything You Need To Know about Appium and SeleniumEverything You Need To Know about Appium and Selenium
Everything You Need To Know about Appium and SeleniumLizzy Guido (she/her)
 
Automating things you didn't know you could automate
Automating things you didn't know you could automateAutomating things you didn't know you could automate
Automating things you didn't know you could automateLizzy Guido (she/her)
 
Wind Tunnel Introduction and Demo Slides
Wind Tunnel Introduction and Demo SlidesWind Tunnel Introduction and Demo Slides
Wind Tunnel Introduction and Demo SlidesLizzy Guido (she/her)
 

More from Lizzy Guido (she/her) (16)

What's New with Perfecto? - June 2017
What's New with Perfecto? - June 2017What's New with Perfecto? - June 2017
What's New with Perfecto? - June 2017
 
What's New with Perfecto? - May 2017
What's New with Perfecto? - May 2017What's New with Perfecto? - May 2017
What's New with Perfecto? - May 2017
 
How to Add Perfecto to Your CI
How to Add Perfecto to Your CIHow to Add Perfecto to Your CI
How to Add Perfecto to Your CI
 
What's New with Perfecto? - April 2017
What's New with Perfecto? - April 2017What's New with Perfecto? - April 2017
What's New with Perfecto? - April 2017
 
TechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UXTechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UX
 
What's New? - March 2017
What's New? - March 2017What's New? - March 2017
What's New? - March 2017
 
TechTalk: What's New with Perfecto?
TechTalk: What's New with Perfecto?TechTalk: What's New with Perfecto?
TechTalk: What's New with Perfecto?
 
Appium vs Appium with Perfecto
Appium vs Appium with PerfectoAppium vs Appium with Perfecto
Appium vs Appium with Perfecto
 
What's New? - February 2017
What's New? - February 2017What's New? - February 2017
What's New? - February 2017
 
Persona Testing - Deep Dive
Persona Testing - Deep DivePersona Testing - Deep Dive
Persona Testing - Deep Dive
 
TechTalk: Report Bugs Like a Boss
TechTalk: Report Bugs Like a BossTechTalk: Report Bugs Like a Boss
TechTalk: Report Bugs Like a Boss
 
TechTalk: Everything You Need to Know about Appium & Selenium
TechTalk: Everything You Need to Know about Appium & SeleniumTechTalk: Everything You Need to Know about Appium & Selenium
TechTalk: Everything You Need to Know about Appium & Selenium
 
Everything You Need To Know about Appium and Selenium
Everything You Need To Know about Appium and SeleniumEverything You Need To Know about Appium and Selenium
Everything You Need To Know about Appium and Selenium
 
Webinar: How to Size a Lab
Webinar: How to Size a LabWebinar: How to Size a Lab
Webinar: How to Size a Lab
 
Automating things you didn't know you could automate
Automating things you didn't know you could automateAutomating things you didn't know you could automate
Automating things you didn't know you could automate
 
Wind Tunnel Introduction and Demo Slides
Wind Tunnel Introduction and Demo SlidesWind Tunnel Introduction and Demo Slides
Wind Tunnel Introduction and Demo Slides
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

TechTalk: Advanced Practices for Visual Test Automation

  • 1. Object Spy, Visual Analysis and XML/Xpath Intro and Demo for Partners David Broerman Partner Enablement Manager Email: davidb@perfectomobile.com
  • 2. Agenda • Intro to Perfecto • XML and Xpath and Objects • What are XML and Xpath? • Working with XML and Xpath • Object Analysis and the Perfecto Object Spy • What is Visual Analysis • Best Practices with Perfecto • Demo Perfecto Automation • Discuss Object Spy , Visual and Xpath Review a Perfecto Lab Selenium/Appium Project in Eclipse • Discuss Object Spy , Visual and Xpath • Q&A
  • 3. Intro to Perfecto Perfecto Offers: A Cloud Based Continuous Quality Lab enabling testing and monitoring of all digital platforms on real devices and real end user conditions, for enterprises adopting agile delivery processes. 3/28/2017 3
  • 4. Intro to Perfecto Dominant leader & visionary Strong Ecosystem Perfecto @ a glance Working with Enterprises and Partners to deliver exceptional digital experiences. 4 Setting the bar for market success • Founded in late 2006, Business HQ in Boston • Over 300 employees globally • Fortune 500 customer base 3/28/2017 “Perfecto Mobile marks shift in mobile apps quality with Continuous Quality Lab”
  • 5. Cloud Based Quality Platform For The Digital Era 3/28/2017 5© 2017, Perfecto Mobile Ltd. All Rights Reserved. Open & Integrated into Dev/Test/Ops Any test tool Any CI server Any test framework Any IDE Any Location Code/Debug Functional Test Performance Test Production Insight One Lab for all Digital Platforms Reporting & Analytics Wind Tunnel Layer Customer Support Browsers Desktops Mobile Devices IoT
  • 6. Open and Integrated 6 Open & Integrated Xcode Selenium 3/28/2017
  • 7. What are XML and Xpath? • XML • EXtensible Markup Language • XML enables you to create data that can read by any application on any platform • Native Object analysis relies on XML • The Object Tree is an XML document • Xpath (XML Path Language) • XPath is the query language for XML documents • Describes a way to locate and process items in XML documents • In automation, Xpath allows us to identify the object/objects
  • 8. Importance of Understanding XML and XPath 8 • Native Object analysis relies on XML • Retrieves the XML document and analyzes it • However, it this is not enough to identify the object using its location in the object tree. This approach is fragile. • It is necessary to use specific XPath expressions to uniquely identify the object. • This will enable your object to be found across multiple platforms and devices.
  • 9. Native Objects Analysis 9 • The Object Tree is an XML document • The way to find elements inside XML is through XPath • To properly work with Objects, a good grasp of XML/XPath is needed.
  • 10. The Perfecto Approach for Mobile Objects Native Object Analysis and Visual Object Analysis = HYBRID APPROACH! Best Practice: Use Native Object Analysis for Navigating and Visual/OCR for Validation. Pros Cons
  • 11. The Object Spy enables working with objects • The Object Spy accesses the XML of the application • Identifies the element and writes an XPath Expression. • May need to export the XML into Firebug/FirePath. • Inserts the expression back into the Object Spy. • Applies the required action: • Click – click on the element • Set – an edit field with a value • Info – to retrieve an element to receive its properties • Find – find an element
  • 12. Website & Apps – Object Trees/Identifying Objects • Web Objects • DOM • Same Tree (PM or Appium Framework) • Native App Objects • PM or Appium framework • Appium -Separate naming for Android and iOS • Perfecto – Script Once • Hybrid Application • PM automation framework • Mix of Native and DOM objects DOM Perfecto Mobile Appium
  • 13. Working with the Object Spy Selected Automation Function and Parameter fields Object XPath Object TreePreview Panel Search and Export Filter displayed Objects Object Properties Automation functions associated with the selected object type
  • 14. Adding Commands from the Object Spy
  • 15. Working with Firebug and FirePath 15
  • 16. Object Spy: Object Locator Available – • Object Locator is availabl e for Native, Web and Hybrid apps. • Easily generate accurate XPath identifiers from within the Perfecto Object Spy • Don’t have to export to XML and use tools such as FireBug and FirePath.
  • 17. Visual Analysis • Visual analysis is an alternative way of interacting with a device. • Its’ source is the screenshot taken from the device (what the user sees). • Perfecto can analyze the screenshot looking for either text or images, with text being the recommended option. Best Practice: Use Native Object Analysis for Navigating and Visual for Validation.
  • 18. Visual - Available Commands • Select - Clicks on the image/text • Find – Finds an image/text for visual relationship • Check – A Checkpoint that validates the text/image appears on the screen • (Sync is same command , Sync has a default timeout of 60 seconds and check does not) • Button – Clicks a Button • Edit - Sets a value inside an input field 3/28/2017 18© 2015, Perfecto Mobile Ltd. All Rights Reserved.
  • 19. Example - Coding Visual Analysis – Java • Visual Analysis – Perfecto Proprietary command executed using RemoteWebDriver • Use the executeScript method • The script parameter contains the command name, in the following format: mobile:command :subcommand.3/28/2017 19© 2015, Perfecto Mobile Ltd. All Rights Reserved. Map<String, Object> params3 = new HashMap<>(); // Check for the text that indicates that the sign in was successful params3.put("content", "Welcome back John"); // allow up-to 30 seconds for the page to display params3.put("timeout", "30"); resultString = (String) driver.executeScript("mobile:checkpoint:text", params3); if (!resultString.equalsIgnoreCase("true")) { System.out.println("'Welcome back John' text not found"); }
  • 20. Did You Know? • When talking with users of the Perfecto Solution • Approximately 90% of testing defects are found using Visual Validation! • Mobile is different as we want to understand the UX • Need to see what the user sees • An object on the screen may be found, but it may be hidden behind something else (need visual validation).
  • 22. Example of Power of Xpath with Objects 22 Let's say that we want to work on a username field. Remember:  The default path generated by the Object Spy refers to its location; its placement on the page.  The placement of that object can change, or be slightly different in another platform (i.e. tablet vs. smartphone).  So, it's important to refer to it by its logical function instead of an arbitrary placement on the page. XPath will allow this to be specified: //[@username]  This expression explicitly refers to the input field called 'username'. Advantages:  It is easy to read.  It is likely to work well with minimal maintenance.  It is likely to be identical across devices and platforms.
  • 23. XPath Expression Syntax 23 Expression Description nodename Selects all nodes with the name "nodename" // Selects nodes in the document from the current node that match the selection no matter where they are //vehicle Selects all vehicle elements no matter where they are in the document //@make Selects all attributes named make //*[@make="Toyota"] Select all attributes named make with value of Toyota //vehicle[@*] Selects all vehicle elements which have any attribute //*[text()=’Corolla’] Select all objects with the text Corolla //vehicle[2] Select the second vehicle element
  • 24. Demo • Open Perfecto Automation and also Open existing Perfecto Lab Selenium/Appium Project in Eclipse • Discuss Object Spy , Visual Analysis and Xpath
  • 25. Resources • Sample script and Demo Apps • https://community.perfectomobile.com/series/25427/posts/1064930 • Working with Object Spy and XPath • https://community.perfectomobile.com/posts/914140-web-objects • XPath Tutorial • http://www.w3schools.com/XPath/ • XML Tutorial • http://www.w3schools.com/xml/
  • 26. Q&A
  • 27. Thank You David Broerman Partner Enablement Manager Email: davidb@perfectomobile.com

Editor's Notes

  1. Hello Everyone – welcome to Perfecto’s tech talk webinar Object Spy, Visual Analysis and XML/Xpath Intro and Demo for Partners. My name is ….
  2. Before we get started with the Agenda, just a quick housekeeping item…at the end we should have a few mins for questions and answers. There is a panel in the webinar named Q&A to submit questions during the webinar, so if you think of something, please ask. If we are unable to get to finish questions for any reason, then we will send out the info to all attendees. Here’s the agenda…
  3. The Perfecto CQ (Continuous Quality) Lab platform is a cloud architected quality platform. One lab for all digital platforms, from browsers, desktops to mobile to IoT We have capabilities to mimic the real user environment with our Wind Tunnel Including Location, orientation, network conditions like 3g 4g, and everything you need to reproduce your users environment While providing Quality visibility and trending with our reporting and analytics for fast feedback loops Completely accessible/embeddable in your SDLC process and tools Accessible from coding to customer support To integrated in Any test tool, CI server, test framework, IDE and location
  4. Perfecto is committed to helping enterprises leverage existing practices, assets and expertise Perfecto Mobile strives integrate with popular tools used by enterprises. Customers can leverage existing assets and expertise . Our support for various tools is constantly expanding. Some customers also take advantage of our published API to create custom extensions to different frameworks.
  5. So what is XML anyway? XML stands for EXtensible Markup Language It’s formal definition: In computing, Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. What does that really mean? XML enables you to create data that can read by any application on any platform Native Object analysis relies on XML The Object Tree is an XML document Now describe xpath
  6. How it works: -Receives Object tree (XML) from App or Website Main Features: -All objects are exposed by Perfecto -Objects can be clicked, set or queried
  7. When the Object Spy accesses the XML (shows the Object Tree), These are the steps to work with objects, we will now drill down and show you step-by-step
  8. Identifying objects on the different types of mobile applications can be done in many ways. We will focus on using the following frameworks, according to Perfecto Mobile best practices: the DOM objects for testing web applications Appium framework for testing Native applications, and Perfecto Mobile framework for testing hybrid applications This Framework selection is for what Trees you see (Perfecto or Appium) (Remember, since in these examples we are working on a native application, we will be setting our Automation Framework and Driver to Appium. To do this, go to: More > Settings > Automation Tab > Framework tab) Using the Object Spy and picking an Automation Framework enables us to find, view properties, and perform interactions on the application using objects (such as a clicking on something on the device screen, selecting an image or text element, and setting text in an edit field). (A little more about identifying objects: Application User Interfaces are drawn to the screen based on a definition (that’s provided by the application) of how and where to draw the different UI Elements. The definition is a hierarchy of available UI Elements that can be described as an Object Tree. The Object Tree for Web applications uses a standard set of UI Element types to describe how to draw the User Interface. This is the DOM tree and the UI Elements in that standard can be used to describe any website or web application.) The Perfecto Mobile and Appium Frameworks: In the world of mobile applications, it is not as simple. Apple has its own proprietary set of UI Elements and this is different from the proprietary set used by Android. Perfecto Mobile created a framework that allows us to translate the competing UI Elements of the different application UI sets into a “common” set of UI Elements and describe the UI structure of an application using these generic UI Elements (Script Once). This is the Perfecto Mobile framework Object Tree. Appium, is used to test native apps, references the UI Elements using the names provided by the proprietary description files. This is the Appium framework Object Tree. The Perfecto Mobile framework identifies the objects in the application with the same standard. This means that the object tree representation of the elements will be the same on both iOS and Android applications. The Appium framework uses two different object tree representations – UI Automator for Android and UI Automation for iOS. This means that when we develop our automation test, according to this mode of work, we will need to create two separate tests (one for Android and another for iOS). (For advanced users, the Perfecto Mobile framework supports identification of the objects either with the application classes or based on a translated generic set of classes. This enables using the same objects for both Android and iOS applications, also referred to as ScriptOnce. This will be covered in later modules.) The framework we choose to work with will determine the object tree representation, in XML format, that we see and work with when using the Perfecto Mobile Object Spy. (For beginner users, each object is refined by a set of attributes that define what is actually displayed. For example, the text attribute defines the text to display.)
  9. The following slide will describe how to use the Object Spy.
  10. Adding commands to the Automation script Click on the object in the preview panel Replace the default XPath with the one you have created Edit any necessary parameter field values Click Add to add the function to your script Optional: enable Execute on Add in the Object Spy to keep the Object Spy window open for additional functions (refresh the Object Spy preview panel to see the updated device screen) Recap We saw the object spy and did the full loop, starting in the mobile application, using the object spy to export the XML, writing the Xpath expression and then copying it back to the object spy. Once the correct expression was in the Spy, we selected the appropriate command, and with “execute on add” we are ready for the next step in the script. This flow is identical for mobile applications and websites and repeats whenever we want to work with objects.
  11. Reading the XML document Go to Firefox Browser – make sure you have Firebug installed Open Firebug (top right of the Firefox browser menu bar) Inspect the element you want to work with by clicking on the Firebug inspector and then on the object in the page The object in the page and the location of it in the tree will be highlighted. Also, a default XPath will be automatically provided. Read the XML, understand what makes the element unique and write an XPath that will be able to find it (more on writing XPath expressions later on)
  12. Example: Android Device B of A Application Sign In Button (Click) Object Locator – provides a more robust xpath instead of just location based
  13. Analyzing a screenshot is slower and less reliable than object analysis, it exists as an addition to objects which is the main way to work. Its use is limited, but when it is needed it provides an excellent solution. Visual analysis is a Perfecto extension to RWD & Appium, providing a comprehensive solution that enables automating all test cases. The main uses for visual analysis are: In cases where object analysis does not work When there’s a need to validate what the user sees on a certain page
  14. There are 5 commands available to use with visual analysis. Exactly the same buttons for both Image and Text. All commands can receive a timeout to which is useful e.g. when a new page is loading. Can work with either text or an image with text being the preferred option. Text is easier to use, works seamlessly across multiple devices and requires the least maintenance.
  15. Since visual analysis is a Perfecto command, we use the executeScript method to run it. The commands require the needle to be provided (in this case the text “welcome back John”) and any additional parameters (in this case we set a timeout of 30 seconds, the system will search for the needle continually for 30 seconds) The returned true/false result can then be handled by the code.
  16. The following slides contain expressions written for various objects in the PM demo applications. Go through the expressions, emphasizing WHAT the expression is saying in plain English, and WHY it is saying it. [Trainer Notes: download the sample test “MobileObjectsSample.java” here https://community.perfectomobile.com/groups/30292/posts/1046689-sample-script-mobile-objects-sample add it to your project workspace run the test on an iOS and an Android device The next slides describe specific XPath expressions, used in the sample, in more detail.]
  17. The elements inside an application or website have a logical meaning a “login” button or “my account” link are not just the third or fourth element, they also have a specific purpose inside the application. Identifying these elements according to what they are, and not just according to where they are will result in a script that is much more robust, readable and valid for multiple devices and platforms. For example, the login button will always stay the login button, another element may be added before it changing the where but the what will remain the same.
  18. XPath allows us to specify: "Give me an element named vehicle that has an attribute with a value Toyota". XPath enables powerful and complex queries quickly and easily. Below is a list of the most common XPath syntax you will need to understand.
  19. Notes: Let’s review a sample test. Use Eclipse Project Named ??? RemoteWebDriverTest.java – run as java test Credentials in code: To run the sample remember to add your credentials and Lab URL String host = “myLab.perfectomobile.com"; capabilities.setCapability("user", “myUser"); capabilities.setCapability("password", “MyPassword"); Selenium and Perfecto Tree Uses Perfecto demo application – tried to login with username, password and validates message
  20. Let’s take a few minutes for Q&A. Remember, there is a panel in the webinar named Q&A to submit questions (if you have already done that, great) if not, please take a minute or so now to type out your questions, We’ll go on mute for a minute, and then come back and answer the questions.