Skip to content
Jeremy Kao edited this page May 5, 2015 · 4 revisions

##Install WinAppDriver:

  1. Download the installer and execute it.

  2. The installer creates a shortcut named WinAppDriver. Use the shortcut to launch WinAppDriver server, which listens on port 4444 on all addresses.

##Not to target a specific app: (whole desktop)

from selenium.webdriver import Remote, DesiredCapabilities

desired_caps = {}
driver = Remote('http://your-winappdriver-server:4444/wd/hub', desired_caps)

##To target a specific store app:

from selenium.webdriver import Remote, DesiredCapabilities

desired_caps = {
    'platformName': 'WindowsModern',
    'app': 'http://your-ci-server/path/to/your/pacakge.zip',
    'packageName': 'your-app-package-name',
}

driver = Remote('http://your-winappdriver-server:4444/wd/hub', desired_caps)

##To target a specific desktop app:

from selenium.webdriver import Remote, DesiredCapabilities

desired_caps = {
    #'platformName': 'Windows',
    'appID': 'your-product-name',
    'app': 'http://your-ci-server/path/to/your/installer.exe',
    'checkInstalledCommand': r'C:\path\to\your\check-installed.bat',
    'openCommand': r'C:\path\to\your\open-app.bat',
    'closeCommand': r'C:\path\to\your\close-app-if-needed.bat',
    'installCommand': r'C:\path\to\your\install-if-needed.bat',
    'uninstallCommand': r'C:\path\to\your\uninstall-if-needed.bat',
    'backupCommand': r'C:\path\to\your\backup-states-if-needed.bat',
    'restoreCommand': r'C:\path\to\your\restore-states-if-needed.bat',
}

driver = Remote('http://your-winappdriver-server:4444/wd/hub', desired_caps)
Clone this wiki locally