SlideShare a Scribd company logo
1 of 31
Download to read offline
12/11/2014
Windows StoreAppsTestAutomation
Jeremy Kao (about.me/imsardine) @ KKBOX SQA Team
GTAC 2014@GoogleKirkland

Seattle,WA
01
Agenda
✤ UI Automation (UIA)!
✤ UIA Security Model!
✤ Survey!
✤ WinAppDriver
01
UI Automation

(UIA)
BellevueTC

Seattle,WA
UIA Overview
✤ Provider and Clients!
✤ Provider API - to create support for custom controls.!
✤ Client API - to create assistive technologies or implement
automated testing.!
✤ Support various UI frameworks, including Win32, WinForms,
WPF, HTML, Silverlight.!
✤ Provide a unified object model that masks any differences in the
UI frameworks.
TestingTools inWindows SDK
✤ Inspect (formerly known as UI Spy) - for inspecting
element's accessibility data, including UIA properties
and MSAA properties.!
✤ AccScope - for evaluating accessibility in the early
phase of development, and finding out areas needed
to be improved.!
✤ Both are good examples of UIA clients.
Key UIA Properties
✤ Automation ID - not localized, preferred.!
✤ Control Type!
✤ Name - may be localized.!
✤ Set a Unique Automation Property for Windows Store
Controls for Testing
01
UIA

Security Model
✤ Be signed and trusted!
✤ uiAccess=“true” (manifest)!
✤ Be installed in a secure location
PikeMarket

Seattle,WA
Security Considerations
To use UIAccess, an assistive technology application needs to:!
✤ Be signed with a certificate to interact with applications running at a
higher privilege level.!
✤ Be trusted by the system and run with administrative privileges. The
application must be installed in a secure location that requires a user
account control (UAC) prompt to write to (for example, the Program
Files folder).!
✤ Be built with a manifest file that includes the UIAccess flag.
Source: Security Considerations for Assistive Technologies (Windows)
Be Signed andTrusted
To interact with applications running at a higher
privilege level.
Process Explorer
uiAccess=“true” (manifest)
To gain access to the protected system UI.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- omitted -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="true"></
requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
The manifest of Inspect.exe:
Test Code in C#
var accField = app.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.AutomationIdProperty, "txt_UserId"));
((ValuePattern)accField.GetCurrentPattern(ValuePattern.Pattern)).setValue("account");
!
var pwdField = app.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.AutomationIdProperty, "txt_UserPwd"));
((ValuePattern)pwdField.GetCurrentPattern(ValuePattern.Pattern)).setValue("secret");
!
var loginBtn = app.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.AutomationIdProperty, "btn_Login"));
((InvokePattern)loginBtn.GetCurrentPattern(InvokePattern.Pattern)).Invoke();
Test Code in Python
01
Survey
✤ Code UI Test (VS Premium/Ultimate)!
✤ IronPython!
✤ Python for .NET!
✤ WinAppDriver
GumWall

PikeMarket,Seattle,WA
Requirements
✤ Scriptable in Python ➠ Robot Framework and PyUIA
integration!
✤ Support Windows Vista (.NET Framework 3.0
included) and above.!
✤ As a testing tool, it is important to have fewer
dependencies.!
✤ Remote control (RC)
RF & PyUIA Integration
Python for .NET != IronPython
If you want to mainly base your code on the .NET
framework, I'd highly recommend IronPython vs
Python.NET. IronPython is pretty much native .NET - so it
just works great when integrating with other .NET languages.!
Python.NET is good if you want to just integrate one or two
components from .NET into a standard python application.
Source: IronPython vs. Python .NET - Stack Overflow
IronPython
✤ It works, but is slow and buggy?!
✤ Not 100% compatible with CPython, subtle differences
may lead to big issues in the future.!
✤ No longer supported by Microsoft.
Python for .NET
✤ It works and performs very well.!
✤ We have to modify Python executable’s manifest and
resign it. (tricky)!
✤ BTW, the Python code manipulating UIA API looks
weird.
01
WinAppDriver
✤ Incubated by KKBOX SQA
team.!
✤ imsardine/winappdriver
(GitHub)!
✤ MIT License
First StarbucksStore

PikeMarket,Seattle,WA
Initial Discussion
URL: http://lnkd.in/eKTVuKk
Selenium for Browsers
Language bindings - Python, Ruby, Node.js, Java, C#, …
Source: http://imsardine.simplbug.com/note/selenium2/selenium2.html
Appium for Mobile Apps
Source: http://imsardine.simplbug.com/note/appium/appium.html
Test
WinAppDriver forWin (Store) Apps
WinAppDriver
UIA Client API
WPFWinFormsWin32
http://*:4444/wd/hub
Test
Windows DevicesWin & Unix-like
JSON/WebDriver!
Wire Protocol
Lang.
Bindings
JSON/WebDriverWire Protocol
Source: The WebDriver Wire Protocol
WinAppDriver forWindows XYZ
WinAppDriver
UIA Client API
Win

Phone?
Store

Apps
Desktop!
Apps
✤ Written in C#.!
✤ Implement JSON/
WebDriver Wire Protocol.!
✤ Support desktop
applications and store
apps.!
✤ WP support is planned.
Test Code in Python
from selenium.webdriver import Remote, DesiredCapabilities

desired_caps = {

'app': 'http://.../AppPackages_0098.zip',

'appUserModelId': '2DE213C9.KKBOX_wttxem0f9q9s0!App',

'appWindowName': 'KKBOX',

'newCommandTimeout': 10 * 60,

}

driver = Remote('http://172.16.41.128:4444/wd/hub', desired_caps)
driver.find_element_by_id(‘txt_UserId’).set_value('account')

driver.find_element_by_id(‘txt_UserPwd’).set_value('secret')

driver.find_element_by_id(‘btn_Login’).click()
Test Code in C#
Benefits
✤ REPL (Read–Eval–Print Loop)!
✤ Freedom of choice!
✤ Programming languages!
✤ Testing frameworks!
✤ Operating systems on which test code will run.!
✤ Support Windows Vista and above.!
✤ Remote control - SUT and test code are not necessary to be run on the
same machine. (deployment flexibility)
Similar Projects
✤ jasongdove/win-driver (prototyping? 08/05/2013)!
✤ Based on TestStask.White and ServiceStack (commercial licensing).!
✤ Does’t support store apps and touch gestures yet.!
✤ Twin (eBay, 08/21/2011)!
✤ Use UIA client API immediately.!
✤ Doesn’t support store apps and touch gestures yet.!
✤ Does not follow the standard, that’s why a dedicated Java client
library is needed.
TODO
✤ Download, install and uninstall app packages automatically.!
✤ PyUIA Integration!
✤ Implement remaining commands defined in the protocol. (logs,
screenshots, …)!
✤ Fast reset - clear data without uninstalling the package!
✤ WP support.!
✤ MacDriver for OS X test automation? (appium/appium-for-mac)
References
✤ UI Automation Overview, Using UI Automation for
Automated Testing, Testing Tools - Windows Automation API!
✤ Automating the testing of Windows 8 apps - Windows 8 app
developer blog - Site Home - MSDN Blogs (09-05-2012)!
✤ UI Automation Security Overview, Security Considerations
for Assistive Technologies (Windows)!
✤ Windows Store Applications and Automated Testing – Part
One, Two, Three (06/12/2013)
01
Q&A
BikeTravel

Seattle,WA
01
WinAppDriver
Dev.
✤ Env. - Windows SDK + Notepad!
✤ How To Build!
✤ Web server (HttpListener), request
manager, session manager, sessions,
endpoints, handlers, JSON (json.NET)
SoundTrain

Seattle,WA

More Related Content

What's hot

Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Gary Stafford
 
Testing with JUnit 5 and Spring
Testing with JUnit 5 and SpringTesting with JUnit 5 and Spring
Testing with JUnit 5 and SpringVMware Tanzu
 
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivElastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivAmazon Web Services
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
Functional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and LogbackFunctional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and LogbackMohammad Sabir Khan
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With AppiumKnoldus Inc.
 
DevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San FranciscoDevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San FranciscoAmazon Web Services
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman
 
Taking AppSec to 11: AppSec Pipeline, DevOps and Making Things Better
Taking AppSec to 11: AppSec Pipeline, DevOps and Making Things BetterTaking AppSec to 11: AppSec Pipeline, DevOps and Making Things Better
Taking AppSec to 11: AppSec Pipeline, DevOps and Making Things BetterMatt Tesauro
 
Vault Open Source vs Enterprise v2
Vault Open Source vs Enterprise v2Vault Open Source vs Enterprise v2
Vault Open Source vs Enterprise v2Stenio Ferreira
 
Java EE Security API - JSR375: Getting Started
Java EE Security API - JSR375: Getting Started Java EE Security API - JSR375: Getting Started
Java EE Security API - JSR375: Getting Started Rudy De Busscher
 
SpringBoot with MyBatis, Flyway, QueryDSL
SpringBoot with MyBatis, Flyway, QueryDSLSpringBoot with MyBatis, Flyway, QueryDSL
SpringBoot with MyBatis, Flyway, QueryDSLSunghyouk Bae
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8Simon Ritter
 

What's hot (20)

Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1
 
Testing with JUnit 5 and Spring
Testing with JUnit 5 and SpringTesting with JUnit 5 and Spring
Testing with JUnit 5 and Spring
 
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivElastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Appium
AppiumAppium
Appium
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Functional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and LogbackFunctional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and Logback
 
Spring boot
Spring bootSpring boot
Spring boot
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
 
Sensu Monitoring
Sensu MonitoringSensu Monitoring
Sensu Monitoring
 
DevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San FranciscoDevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San Francisco
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
 
Taking AppSec to 11: AppSec Pipeline, DevOps and Making Things Better
Taking AppSec to 11: AppSec Pipeline, DevOps and Making Things BetterTaking AppSec to 11: AppSec Pipeline, DevOps and Making Things Better
Taking AppSec to 11: AppSec Pipeline, DevOps and Making Things Better
 
Vault Open Source vs Enterprise v2
Vault Open Source vs Enterprise v2Vault Open Source vs Enterprise v2
Vault Open Source vs Enterprise v2
 
Log analytics with ELK stack
Log analytics with ELK stackLog analytics with ELK stack
Log analytics with ELK stack
 
Java EE Security API - JSR375: Getting Started
Java EE Security API - JSR375: Getting Started Java EE Security API - JSR375: Getting Started
Java EE Security API - JSR375: Getting Started
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
SpringBoot with MyBatis, Flyway, QueryDSL
SpringBoot with MyBatis, Flyway, QueryDSLSpringBoot with MyBatis, Flyway, QueryDSL
SpringBoot with MyBatis, Flyway, QueryDSL
 
Fluent validation
Fluent validationFluent validation
Fluent validation
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 

Similar to WinAppDriver - Windows Store Apps Test Automation

From Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaFrom Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaAlexandre Morgaut
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxOWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxnmk42194
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxjohnpragasam1
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxazida3
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxcgt38842
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeMark Meyer
 
Secure Coding For Java - Une introduction
Secure Coding For Java - Une introductionSecure Coding For Java - Une introduction
Secure Coding For Java - Une introductionSebastien Gioria
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceJen Looper
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java DevelopersYakov Fain
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
Java EE Application Security With PicketLink
Java EE Application Security With PicketLinkJava EE Application Security With PicketLink
Java EE Application Security With PicketLinkpigorcraveiro
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Codemotion
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToGlobalLogic Ukraine
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with exampleshadabgilani
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance testBryan Liu
 
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade ServerlessKatyShimizu
 

Similar to WinAppDriver - Windows Store Apps Test Automation (20)

From Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaFrom Web App Model Design to Production with Wakanda
From Web App Model Design to Production with Wakanda
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxOWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptx
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
 
Secure Coding For Java - Une introduction
Secure Coding For Java - Une introductionSecure Coding For Java - Une introduction
Secure Coding For Java - Une introduction
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium tests
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Android CI and Appium
Android CI and AppiumAndroid CI and Appium
Android CI and Appium
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
Java EE Application Security With PicketLink
Java EE Application Security With PicketLinkJava EE Application Security With PicketLink
Java EE Application Security With PicketLink
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How To
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

WinAppDriver - Windows Store Apps Test Automation

  • 1. 12/11/2014 Windows StoreAppsTestAutomation Jeremy Kao (about.me/imsardine) @ KKBOX SQA Team GTAC 2014@GoogleKirkland
 Seattle,WA
  • 2. 01 Agenda ✤ UI Automation (UIA)! ✤ UIA Security Model! ✤ Survey! ✤ WinAppDriver
  • 4. UIA Overview ✤ Provider and Clients! ✤ Provider API - to create support for custom controls.! ✤ Client API - to create assistive technologies or implement automated testing.! ✤ Support various UI frameworks, including Win32, WinForms, WPF, HTML, Silverlight.! ✤ Provide a unified object model that masks any differences in the UI frameworks.
  • 5. TestingTools inWindows SDK ✤ Inspect (formerly known as UI Spy) - for inspecting element's accessibility data, including UIA properties and MSAA properties.! ✤ AccScope - for evaluating accessibility in the early phase of development, and finding out areas needed to be improved.! ✤ Both are good examples of UIA clients.
  • 6. Key UIA Properties ✤ Automation ID - not localized, preferred.! ✤ Control Type! ✤ Name - may be localized.! ✤ Set a Unique Automation Property for Windows Store Controls for Testing
  • 7. 01 UIA
 Security Model ✤ Be signed and trusted! ✤ uiAccess=“true” (manifest)! ✤ Be installed in a secure location PikeMarket
 Seattle,WA
  • 8. Security Considerations To use UIAccess, an assistive technology application needs to:! ✤ Be signed with a certificate to interact with applications running at a higher privilege level.! ✤ Be trusted by the system and run with administrative privileges. The application must be installed in a secure location that requires a user account control (UAC) prompt to write to (for example, the Program Files folder).! ✤ Be built with a manifest file that includes the UIAccess flag. Source: Security Considerations for Assistive Technologies (Windows)
  • 9. Be Signed andTrusted To interact with applications running at a higher privilege level. Process Explorer
  • 10. uiAccess=“true” (manifest) To gain access to the protected system UI. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <!-- omitted --> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="true"></ requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> </assembly> The manifest of Inspect.exe:
  • 11. Test Code in C# var accField = app.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "txt_UserId")); ((ValuePattern)accField.GetCurrentPattern(ValuePattern.Pattern)).setValue("account"); ! var pwdField = app.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "txt_UserPwd")); ((ValuePattern)pwdField.GetCurrentPattern(ValuePattern.Pattern)).setValue("secret"); ! var loginBtn = app.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "btn_Login")); ((InvokePattern)loginBtn.GetCurrentPattern(InvokePattern.Pattern)).Invoke(); Test Code in Python
  • 12. 01 Survey ✤ Code UI Test (VS Premium/Ultimate)! ✤ IronPython! ✤ Python for .NET! ✤ WinAppDriver GumWall
 PikeMarket,Seattle,WA
  • 13. Requirements ✤ Scriptable in Python ➠ Robot Framework and PyUIA integration! ✤ Support Windows Vista (.NET Framework 3.0 included) and above.! ✤ As a testing tool, it is important to have fewer dependencies.! ✤ Remote control (RC)
  • 14. RF & PyUIA Integration
  • 15. Python for .NET != IronPython If you want to mainly base your code on the .NET framework, I'd highly recommend IronPython vs Python.NET. IronPython is pretty much native .NET - so it just works great when integrating with other .NET languages.! Python.NET is good if you want to just integrate one or two components from .NET into a standard python application. Source: IronPython vs. Python .NET - Stack Overflow
  • 16. IronPython ✤ It works, but is slow and buggy?! ✤ Not 100% compatible with CPython, subtle differences may lead to big issues in the future.! ✤ No longer supported by Microsoft.
  • 17. Python for .NET ✤ It works and performs very well.! ✤ We have to modify Python executable’s manifest and resign it. (tricky)! ✤ BTW, the Python code manipulating UIA API looks weird.
  • 18. 01 WinAppDriver ✤ Incubated by KKBOX SQA team.! ✤ imsardine/winappdriver (GitHub)! ✤ MIT License First StarbucksStore
 PikeMarket,Seattle,WA
  • 20. Selenium for Browsers Language bindings - Python, Ruby, Node.js, Java, C#, … Source: http://imsardine.simplbug.com/note/selenium2/selenium2.html
  • 21. Appium for Mobile Apps Source: http://imsardine.simplbug.com/note/appium/appium.html
  • 22. Test WinAppDriver forWin (Store) Apps WinAppDriver UIA Client API WPFWinFormsWin32 http://*:4444/wd/hub Test Windows DevicesWin & Unix-like JSON/WebDriver! Wire Protocol Lang. Bindings
  • 23. JSON/WebDriverWire Protocol Source: The WebDriver Wire Protocol
  • 24. WinAppDriver forWindows XYZ WinAppDriver UIA Client API Win
 Phone? Store
 Apps Desktop! Apps ✤ Written in C#.! ✤ Implement JSON/ WebDriver Wire Protocol.! ✤ Support desktop applications and store apps.! ✤ WP support is planned.
  • 25. Test Code in Python from selenium.webdriver import Remote, DesiredCapabilities
 desired_caps = {
 'app': 'http://.../AppPackages_0098.zip',
 'appUserModelId': '2DE213C9.KKBOX_wttxem0f9q9s0!App',
 'appWindowName': 'KKBOX',
 'newCommandTimeout': 10 * 60,
 }
 driver = Remote('http://172.16.41.128:4444/wd/hub', desired_caps) driver.find_element_by_id(‘txt_UserId’).set_value('account')
 driver.find_element_by_id(‘txt_UserPwd’).set_value('secret')
 driver.find_element_by_id(‘btn_Login’).click() Test Code in C#
  • 26. Benefits ✤ REPL (Read–Eval–Print Loop)! ✤ Freedom of choice! ✤ Programming languages! ✤ Testing frameworks! ✤ Operating systems on which test code will run.! ✤ Support Windows Vista and above.! ✤ Remote control - SUT and test code are not necessary to be run on the same machine. (deployment flexibility)
  • 27. Similar Projects ✤ jasongdove/win-driver (prototyping? 08/05/2013)! ✤ Based on TestStask.White and ServiceStack (commercial licensing).! ✤ Does’t support store apps and touch gestures yet.! ✤ Twin (eBay, 08/21/2011)! ✤ Use UIA client API immediately.! ✤ Doesn’t support store apps and touch gestures yet.! ✤ Does not follow the standard, that’s why a dedicated Java client library is needed.
  • 28. TODO ✤ Download, install and uninstall app packages automatically.! ✤ PyUIA Integration! ✤ Implement remaining commands defined in the protocol. (logs, screenshots, …)! ✤ Fast reset - clear data without uninstalling the package! ✤ WP support.! ✤ MacDriver for OS X test automation? (appium/appium-for-mac)
  • 29. References ✤ UI Automation Overview, Using UI Automation for Automated Testing, Testing Tools - Windows Automation API! ✤ Automating the testing of Windows 8 apps - Windows 8 app developer blog - Site Home - MSDN Blogs (09-05-2012)! ✤ UI Automation Security Overview, Security Considerations for Assistive Technologies (Windows)! ✤ Windows Store Applications and Automated Testing – Part One, Two, Three (06/12/2013)
  • 31. 01 WinAppDriver Dev. ✤ Env. - Windows SDK + Notepad! ✤ How To Build! ✤ Web server (HttpListener), request manager, session manager, sessions, endpoints, handlers, JSON (json.NET) SoundTrain
 Seattle,WA