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

Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated TestingLee Englestone
 
Sonarqube
SonarqubeSonarqube
SonarqubeKalkey
 
What is integration testing
What is integration testingWhat is integration testing
What is integration testingTestingXperts
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in PracticeSteven Mak
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?Dmitry Buzdin
 
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Edureka!
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-conceptsmedsherb
 
Seven testing principles
Seven testing principlesSeven testing principles
Seven testing principlesVaibhav Dash
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentMike Douglas
 
Top 20 best automation testing tools
Top 20 best automation testing toolsTop 20 best automation testing tools
Top 20 best automation testing toolsQACraft
 

What's hot (20)

TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Software Testing or Quality Assurance
Software Testing or Quality AssuranceSoftware Testing or Quality Assurance
Software Testing or Quality Assurance
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
Sonarqube
SonarqubeSonarqube
Sonarqube
 
What is integration testing
What is integration testingWhat is integration testing
What is integration testing
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in Practice
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
Testing in go
Testing in goTesting in go
Testing in go
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
Seven testing principles
Seven testing principlesSeven testing principles
Seven testing principles
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Unit Testing in Android
Unit Testing in AndroidUnit Testing in Android
Unit Testing in Android
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
Top 20 best automation testing tools
Top 20 best automation testing toolsTop 20 best automation testing tools
Top 20 best automation testing tools
 

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 version 2
OWASP_Top_Ten_Proactive_Controls version 2OWASP_Top_Ten_Proactive_Controls version 2
OWASP_Top_Ten_Proactive_Controls version 2ssuser18349f1
 
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
 

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 version 2
OWASP_Top_Ten_Proactive_Controls version 2OWASP_Top_Ten_Proactive_Controls version 2
OWASP_Top_Ten_Proactive_Controls version 2
 
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
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 

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