Silk AppDriver is an implementation of the W3C WebDriver protocol for native (Windows) and mobile (Android and iOS) applications, built on top of Silk Test.
Silk AppDriver is an implementation of the W3C WebDriver protocol for native (Windows) and mobile (Android and iOS) applications, built on top of Silk Test. The purpose of this project is to enable users of Silk Test to write tests for all kinds of applications using the WebDriver API in addition to the existing Silk Test APIs.
java -jar silk-appdriver.jar
server.port
system property, for example java -Dserver.port=8123 -jar silk-appdriver.jar
Here’s a minimal example written in Python that automates notepad.exe using Silk AppDriver:
from selenium import webdriver
driver = webdriver.Remote(
command_executor='http://127.0.0.1:8080',
desired_capabilities={'app': '%WINDIR%\\notepad.exe'})
textfield = driver.find_element_by_xpath("//TextField")
textfield.clear()
textfield.send_keys("hello from python!")
driver.find_element_by_xpath("//Menu[@caption='File']").click()
driver.find_element_by_xpath("//MenuItem[@caption='Exit']").click()
driver.find_element_by_xpath("//PushButton[@caption=\"Don't Save\"]").click()
driver.quit()
Further examples can be found here:
To build Silk AppDriver on the command line:
mvn clean install
)java -jar target/silk-appdriver.jar
To build Silk WebDriver in the IDE:
The controller stub was auto-generated based on the “List of Endpoints” in the WebDriver standard using a simple Silk4J script. That can be found here: appdriver-generate
Silk AppDriver is still in an early stage and needs your help and contributions to get better!
Only xpath is currently supported as a locator strategy. Ony “Silk Test xpath” locators will work.
The following table lists all methods listed in the W3C spec and the current status of the implementation in Silk AppDriver.
Command | Status | Comment |
---|---|---|
New Session | Done | |
Delete Session | Done | |
Status | Done | |
Get Timeouts | TODO | |
Set Timeouts | TODO | |
Go | Done | Not supported (yields “unknown command”) |
Get Current URL | Done | Not supported (yields “unknown command”) |
Back | Done | Not supported (yields “unknown command”) |
Forward | Done | Not supported (yields “unknown command”) |
Refresh | Done | Not supported (yields “unknown command”) |
Get Title | Done | |
Get Window Handle | Done | |
Close Window | Done | |
Switch To Window | Done | |
Get Window Handles | Done | |
Switch To Frame | Done | Not supported (yields “unknown command”) |
Switch To Parent Frame | Done | Not supported (yields “unknown command”) |
Get Window Rect | Done | |
Set Window Rect | Done | |
Maximize Window | Done | |
Minimize Window | Done | |
Fullscreen Window | Done | |
Get Active Element | TODO | |
Find Element | Done | |
Find Elements | Done | |
Find Element From Element | Done | |
Find Elements From Element | Done | |
Is Element Selected | TODO | |
Get Element Attribute | TODO | |
Get Element Property | Done | |
Get Element CSS Value | Done | Not supported (yields “unknown command”) |
Get Element Text | Done | |
Get Element Tag Name | Done | Yields the class name |
Get Element Rect | Done | |
Is Element Enabled | Done | |
Element Click | Done | |
Element Clear | Done | |
Element Send Keys | Partly done | Missing: Handling of special keys |
Get Page Source | Done | Not supported (yields “unknown command”) |
Execute Script | Done | Not supported (yields “unknown command”) |
Execute Async Script | Done | Not supported (yields “unknown command”) |
Get All Cookies | Done | Not supported (yields “unknown command”) |
Get Named Cookie | Done | Not supported (yields “unknown command”) |
Add Cookie | Done | Not supported (yields “unknown command”) |
Delete Cookie | Done | Not supported (yields “unknown command”) |
Delete All Cookies | Done | Not supported (yields “unknown command”) |
Perform Actions | TODO | |
Release Actions | TODO | |
Dismiss Alert | TODO | |
Accept Alert | TODO | |
Get Alert Text | TODO | |
Send Alert Text | TODO | |
Take Screenshot | Done | Takes a screenshot of the entire desktop |
Take Element Screenshot | Done |
The biggest TODOs currently are:
sendKeys
(map to Silk Test keys!)executeScript
with a custom command to start/stop TrueLog?Code provided in this repository is licensed under the Apache 2.0.
You want to contribute to Silk AppDriver? Great!
Changes may be contributed after signing the Micro Focus Individual Contributor License Agreement 1.0.
Signed contributor agreements are to be sent, via PDF, to licensing@microfocus.com.
You will be notified via email when the agreement has been accepted by Micro Focus.