SlideShare a Scribd company logo
3
Most read
6
Most read
9
Most read
WinAppDriver Development
Jeremy Kao (about.me/imsardine) @ KKBOX SQA

17/12/2014
Agenda
• Environment Setup

• JSON Wire/WebDriver Protocol
and Routing

• WinAppDriver Components

• TODO
WinAppDriver Overview
Test
WinAppDriver
UIA Client API
WPFWinFormsWin32
http://*:4444/wd/hub
Test
Windows DevicesWin & Unix-like
JSON/WebDriver!
Wire Protocol
Lang.
Bindings
DEV Environment Setup
• Prerequisites
• .NET Framework 3.0 (Vista) and above.
• Windows SDK
• Configure PATH environment variable

SET PATH=%PATH%;C:WindowsMicrosoft.NETFramework<VERSION>;C:
Program Files (x86)Windows Kits<VERSION>bin<ARCH>
• Get the source code from GitHub

git clone git@github.com:imsardine/winappdriver.git
• Build the project

msbuild.exe src/ActivateStoreApp/ActivateStoreApp.csproj

msbuild.exe src/WinAppDriver/WinAppDriver.csproj
Deployment
• Prerequisites
• .NET Framework 3.0 (Vista) and above.
• Windows 8.0 and above for store apps.
• Configure firewall and URL namespace reservations.
• Import WinAppDriver Test Certificate to Trusted Root
Certification Authorities store.
• Copy the following files to a secure location

WinAppDriver.exe, ActivateStoreApp.exe, Newtonsoft.Json.dll
JSON/WebDriver Wire Protocol
• The WebDriver Wire Protocol - Selenium
• For example
• Find an element

POST session/:sessionId/element
• Click an element

POST session/:sessionId/element/:id/click
Routing
• Endpoints

POST session/:sessionId/element
• Handlers with Route attribute (WinAppDriver.RouteAttribute)

[Route("POST", "/session/:sessionId/element")]

class FindElementHandler : IHandler {

...

}
• RequestManager.AddHandler(handler)
Handler
WinAppDriver Components
HTTP
Server
Request

Manager
Session

Manager
Handler
UIA

Client API
WebDriver
Lang. Bindings
HTTP Server (WinAppDriver.Server)
• Based on System.Net.HttpListener
• Listen on http://+:4444/wd/hub/
• Configure firewall and Namespace Reservations

(elevated mode)

netsh http add urlacl url=http://+:4444/wd/hub/ user=Everyone
Request Manager (WinAppDriver.RequestManager)
• Manage endpoints (WinAppDriver.EndPoint) and handlers
(WinAppDriver.IHandler).
• Dispatch requests to corresponding handlers.
• Parse URL parameters and prepare the session object.
• Serialise returned object(s) to JSON.
Handlers (WinAppDriver.IHandler)
1. Parse request body, that is deserialising JSON

FindElementRequest request =
JsonConvert.DeserializeObject<FindElementRequest>(body);
2. Search for or manipulate UI elements using the UIA Client API.
3. Return a Dictionary or Data Transfer Object (DTO).

return new Dictionary<string, object> {

{ "sessionId", session.ID },

{ "status", 0 },

{ "value",

new Dictionary<string, int> {

{ "ELEMENT", id }

}

}

};
Session Manager (WinAppDriver.SessionManager)
• Manage sessions (WinAppDriver.Session).
• A session caches references to UI elements
(System.Windows.Automation.AutomationElement) for
subsequent interactions.
TODO
• Build system
• Solution file (.sln)
• Remove third-party assemblies from Git repo.
• Travis CI build (low priority)
• Exception handling, e.g., throw new ElementNotFoundException()
• Discover and register all handlers automatically.
• Download, install and uninstall app packages automatically.
• Implement remaining commands defined in the protocol. (logs, screenshots,
…)
• Fast reset - clear data without uninstalling the package
References
• Configuring HTTP and HTTPS - MSDN
• MSBuild
• P of EAA: Data Transfer Object

More Related Content

PPT
презентація 9
PPT
кунезіологічні вправи в корекції психомовного й моторного розвитку
DOCX
Методика виявлення страхів та тривожності .роговDocx
DOC
наказ про підсумки
PDF
Використання арт- терапії в роботі практичного психолога
DOC
Календарно-тематичний план з фізичної культури в 10 класі
PDF
WinAppDriver - Windows Store Apps Test Automation
PDF
PyUIA 0.3
презентація 9
кунезіологічні вправи в корекції психомовного й моторного розвитку
Методика виявлення страхів та тривожності .роговDocx
наказ про підсумки
Використання арт- терапії в роботі практичного психолога
Календарно-тематичний план з фізичної культури в 10 класі
WinAppDriver - Windows Store Apps Test Automation
PyUIA 0.3

Similar to WinAppDriver Development (20)

PPTX
A Deep Dive into the W3C WebDriver Specification
PPT
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
PDF
Selenium python
PPTX
Web driver training
PDF
Testing desktop apps with selenium
PPTX
CS02A - Interacting with applications.pptx
PPTX
Introduction to APIs & how to automate APIs testing with selenium web driver?
PDF
Streamline Testing: Transition from Manual to Automation with Selenium & C#
PDF
Streamline Testing: Transition from Manual to Automation with Selenium & C#
PDF
Handson Selenium Webdriver With Java A Deep Dive Into The Development Of Endt...
PDF
Dev Dives: Boosting Productivity with Coded Automation and Autopilot™
PPTX
Web testing with Selenium
PPTX
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
PDF
Webdriver.io
PDF
Acceptance Testing of Web UI
PDF
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
PPTX
Windows Phone 7 and Silverlight
PPTX
Selenium withnet
PPTX
OWASP ZAP Workshop for QA Testers
PPTX
Testing ASP.NET - Progressive.NET
A Deep Dive into the W3C WebDriver Specification
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
Selenium python
Web driver training
Testing desktop apps with selenium
CS02A - Interacting with applications.pptx
Introduction to APIs & how to automate APIs testing with selenium web driver?
Streamline Testing: Transition from Manual to Automation with Selenium & C#
Streamline Testing: Transition from Manual to Automation with Selenium & C#
Handson Selenium Webdriver With Java A Deep Dive Into The Development Of Endt...
Dev Dives: Boosting Productivity with Coded Automation and Autopilot™
Web testing with Selenium
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Webdriver.io
Acceptance Testing of Web UI
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Windows Phone 7 and Silverlight
Selenium withnet
OWASP ZAP Workshop for QA Testers
Testing ASP.NET - Progressive.NET
Ad

Recently uploaded (20)

PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Patient Appointment Booking in Odoo with online payment
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
17 Powerful Integrations Your Next-Gen MLM Software Needs
Autodesk AutoCAD Crack Free Download 2025
iTop VPN Free 5.6.0.5262 Crack latest version 2025
CHAPTER 2 - PM Management and IT Context
Computer Software and OS of computer science of grade 11.pptx
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Monitoring Stack: Grafana, Loki & Promtail
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Why Generative AI is the Future of Content, Code & Creativity?
Designing Intelligence for the Shop Floor.pdf
Digital Systems & Binary Numbers (comprehensive )
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
iTop VPN Crack Latest Version Full Key 2025
Complete Guide to Website Development in Malaysia for SMEs
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Patient Appointment Booking in Odoo with online payment
Ad

WinAppDriver Development

  • 1. WinAppDriver Development Jeremy Kao (about.me/imsardine) @ KKBOX SQA
 17/12/2014
  • 2. Agenda • Environment Setup • JSON Wire/WebDriver Protocol and Routing • WinAppDriver Components • TODO
  • 3. WinAppDriver Overview Test WinAppDriver UIA Client API WPFWinFormsWin32 http://*:4444/wd/hub Test Windows DevicesWin & Unix-like JSON/WebDriver! Wire Protocol Lang. Bindings
  • 4. DEV Environment Setup • Prerequisites • .NET Framework 3.0 (Vista) and above. • Windows SDK • Configure PATH environment variable
 SET PATH=%PATH%;C:WindowsMicrosoft.NETFramework<VERSION>;C: Program Files (x86)Windows Kits<VERSION>bin<ARCH> • Get the source code from GitHub
 git clone git@github.com:imsardine/winappdriver.git • Build the project
 msbuild.exe src/ActivateStoreApp/ActivateStoreApp.csproj
 msbuild.exe src/WinAppDriver/WinAppDriver.csproj
  • 5. Deployment • Prerequisites • .NET Framework 3.0 (Vista) and above. • Windows 8.0 and above for store apps. • Configure firewall and URL namespace reservations. • Import WinAppDriver Test Certificate to Trusted Root Certification Authorities store. • Copy the following files to a secure location
 WinAppDriver.exe, ActivateStoreApp.exe, Newtonsoft.Json.dll
  • 6. JSON/WebDriver Wire Protocol • The WebDriver Wire Protocol - Selenium • For example • Find an element
 POST session/:sessionId/element • Click an element
 POST session/:sessionId/element/:id/click
  • 7. Routing • Endpoints
 POST session/:sessionId/element • Handlers with Route attribute (WinAppDriver.RouteAttribute)
 [Route("POST", "/session/:sessionId/element")]
 class FindElementHandler : IHandler {
 ...
 } • RequestManager.AddHandler(handler)
  • 9. HTTP Server (WinAppDriver.Server) • Based on System.Net.HttpListener • Listen on http://+:4444/wd/hub/ • Configure firewall and Namespace Reservations
 (elevated mode)
 netsh http add urlacl url=http://+:4444/wd/hub/ user=Everyone
  • 10. Request Manager (WinAppDriver.RequestManager) • Manage endpoints (WinAppDriver.EndPoint) and handlers (WinAppDriver.IHandler). • Dispatch requests to corresponding handlers. • Parse URL parameters and prepare the session object. • Serialise returned object(s) to JSON.
  • 11. Handlers (WinAppDriver.IHandler) 1. Parse request body, that is deserialising JSON
 FindElementRequest request = JsonConvert.DeserializeObject<FindElementRequest>(body); 2. Search for or manipulate UI elements using the UIA Client API. 3. Return a Dictionary or Data Transfer Object (DTO).
 return new Dictionary<string, object> {
 { "sessionId", session.ID },
 { "status", 0 },
 { "value",
 new Dictionary<string, int> {
 { "ELEMENT", id }
 }
 }
 };
  • 12. Session Manager (WinAppDriver.SessionManager) • Manage sessions (WinAppDriver.Session). • A session caches references to UI elements (System.Windows.Automation.AutomationElement) for subsequent interactions.
  • 13. TODO • Build system • Solution file (.sln) • Remove third-party assemblies from Git repo. • Travis CI build (low priority) • Exception handling, e.g., throw new ElementNotFoundException() • Discover and register all handlers automatically. • Download, install and uninstall app packages automatically. • Implement remaining commands defined in the protocol. (logs, screenshots, …) • Fast reset - clear data without uninstalling the package
  • 14. References • Configuring HTTP and HTTPS - MSDN • MSBuild • P of EAA: Data Transfer Object