Code Monkey home page Code Monkey logo

win-app-driver's Introduction

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

win-app-driver's People

Contributors

kzo8xekb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

win-app-driver's Issues

A ToDo list that implements WinAppDriver commands.

List of WinAppDriver commands supported by closures (ver. 0.1.29)

Commands with a check in the list below have been tested to work.

actions.lisp (ver. 0.1.24 split from api.lisp)

  • :button-down
  • :button-up
  • :click
  • :doubleclick
  • :move-to
  • :touch-click
  • :touch-double-click (ver. 0.1.25 renamed from touch-doubleclick)
  • :touch-down
  • :touch-flick
  • :touch-long-click (ver. 0.1.25 renamed from touch-longclick)
  • :touch-move
  • :touch-scroll
  • :touch-up

appium.lisp (ver. 0.1.24 split from api.lisp)

  • :close-app (for appium command)
  • :launch-app (for appium command)

contexts.lisp (ver. 0.1.24 merged from window.lisp and window-handle.lisp)

  • :close-window
  • :get-window-position-with-window-handle
  • :get-window-size
  • :get-window-size-with-window-handle
  • :maximize-window
  • :set-window-position-with-window-handle
  • :set-window-size
  • :set-window-size-with-window-handle
  • :window-maximize-with-window-handle
  • :get-window-handle
  • :get-window-handles

document.lisp (ver. 0.1.24 renamed from source.lisp)

  • :get-source

element-interaction.lisp (ver. 0.1.24 renamed from keys.lisp)

  • :send-keys
  • :send-string
  • :element-clear (ver. 0.1.24 moved from element.lisp)
  • :element-click (ver. 0.1.24 moved from element.lisp)
  • :element-send-keys (ver. 0.1.21 renamed from set-element-keys & moved from element.lisp)
  • :element-send-string

element-retrieval.lisp (ver. 0.1.24 split from element.lisp)

  • :active-element
  • :find-element
  • :find-element-from-element
  • :find-elements
  • :find-elements-from-element

element-state.lisp (ver. 0.1.24 split from element.lisp)

  • :element-equals
  • :get-element-attribute
  • :get-element-location
  • :get-element-location-in-view
  • :get-element-name
  • :get-element-size
  • :get-element-text
  • :is-element-displayed
  • :is-element-enabled
  • :is-element-selected

location.lisp (ver. 0.1.26 split from actions.lisp)

  • :location

navigation.lisp (ver. 0.1.24 merged from api.lisp and title.lisp)

  • :back
  • :forward
  • :get-title

orientation.lisp

  • :orientation

screen-capture.lisp (ver. 0.1.21 renamed from screenshot.lisp)

  • :take-screenshot
  • :take-element-screenshot (ver. 0.1.21 moved from element.lisp)

session.lisp

  • :delete-session
  • :get-sessions
  • :new-session

status.lisp

  • :status

timeouts.lisp

  • :set-timeouts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.