kzO8Xekb / win-app-driver

WinAppDriver with Common Lisp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

win-app-driver

Windows Application Driver (WinAppDriver) is a service to support Selenium-like UI Test Automation on Windows Applications. This package allows WinAppDriver to be used with Common Lisp.

As this program is a prototype, there may be inconvenient features or bugs. In particular, functions that require the use of "Appium" should not work at all.

Thank you very much.

Requirements

  1. Windows 10 PC with the latest Windows 10 version (Version 1607 or later)
  2. WinAppDriver
  3. Steel Bank Common Lisp(SBCL) 2.2.4 for Windows

Common Lisp packages

  1. quicklisp
  2. alexandria
  3. cl-ppcre
  4. dexador
  5. jonathan
  6. let-over-lambda
  7. local-time
  8. trivial-macroexpand-all

Tools to assist with element id research.

  1. Accessibility Insights for Windows
  2. WinAppDriver UI Recorder Tool (Supplementary tools for WinAppDriver)

Usage

  1. Download and install WinAppDriver from the official website.
  2. Start WinAppDriver Server.
  3. Extract the complete set of win-app-driver files to your quicklisp/local-projects/win-app-driver folder.
  4. Start SBCL.
  5. Perform as follows.
(ql:quickload :win-app-driver)

(setf (symbol-function 'notepad-session) (win-app-driver:create-session))
;#<FUNCTION (LAMBDA (&REST #:ARGS539) :IN WIN-APP-DRIVER:CREATE-SESSION) {10025B50FB}>

(notepad-session
  :new-session
  :host "localhost"                        ; optional default "localhost".
  :port 12345                              ; optional default 4723.
  :app  "C:/Windows/System32/notepad.exe") ; "\" does not work. Please change to "/".
;"{\"sessionId\":\"CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56\",\"status\":0,\"value\":{\"app\":\"C:/Windows/System32/notepad.exe\",\"platformName\":\"Windows\"}}"
;200
;#<HASH-TABLE :TEST EQUAL :COUNT 4 {10025C42D3}>
;#<QURI.URI.HTTP:URI-HTTP http://localhost:12345/session>

(notepad-session
  :status)
;"{\"build\":{\"revision\":\"2003\",\"time\":\"Wed Aug 26 07:56:06 2020\",\"version\":\"1.2.2009\"},\"os\":{\"arch\":\"amd64\",\"name\":\"windows\",\"version\":\"10.0.22000\"}}"
;200
;#<HASH-TABLE :TEST EQUAL :COUNT 4 {10025C74B3}>
;#<QURI.URI.HTTP:URI-HTTP http://localhost:12345/status>

(notepad-session
  :find-element
  :class-name "RichEditD2DPT")
;"{\"sessionId\":\"CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56\",\"status\":0,\"value\":{\"ELEMENT\":\"42.3802786\"}}"
;200
;#<HASH-TABLE :TEST EQUAL :COUNT 4 {10025CD483}>
;#<QURI.URI.HTTP:URI-HTTP http://localhost:12345/session/CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56/element>

(progn
  (notepad-session
    :element-click "42.3802786") ; The argument is the ELEMENT investigated in find-element.
  (notepad-session
    :send-string "hello, world"))
;"{\"sessionId\":\"CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56\",\"status\":0}"
;200
;#<HASH-TABLE :TEST EQUAL :COUNT 4 {10025E52F3}>
;#<QURI.URI.HTTP:URI-HTTP http://localhost:12345/session/CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56/keys>

(notepad-session
  :get-element-text "42.3802786")
;"{\"sessionId\":\"CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56\",\"status\":0,\"value\":\"hello, world\"}"
;200
;#<HASH-TABLE :TEST EQUAL :COUNT 4 {10025E7C03}>
;#<QURI.URI.HTTP:URI-HTTP http://localhost:12345/session/CF3B1FB7-E4F5-485F-AB3A-D8CDEAD48E56/element/42.3802786/text>

Installation

Extract the complete set of win-app-driver files to your quicklisp/local-projects/win-app-driver folder.

References

  1. WinAppDriver Command Summary
  2. WebDriver Specification(W3C Working Draft)
  3. JSON Wire Protocol Specification

License

MIT License

Author

  • kzO8Xekb

Copyright

Copyright (c) 2022 kzO8Xekb

About

WinAppDriver with Common Lisp.

License:MIT License


Languages

Language:Common Lisp 100.0%