-
Notifications
You must be signed in to change notification settings - Fork 11
Store Apps
Take Twitter app as an example, even you do not have the source code.
First, install the app from Windows Store, and then try to find the package name of the app. In this case, it is 9E2F88E3.Twitter
.
Some capabilities should/could be specified:
-
platformName - (Required)
WindowsModern
, which indicates the application under test (AUT) is a store app. - packageName - (Required) The package name of the app. Please note that it is not the application name visible to users.
-
resetStrategy - (Optional) The strategy of managing application state before a session starts and while closing the session. It defaults to fast reset (
fastReset
), that is to back up the initial state (or restore it) just before a session starts. Refer to Reset Strategies for more details.
(Python)
from selenium.webdriver import Remote
desired_caps = {
'platformName': 'WindowsModern',
'packageName': '9E2F88E3.Twitter',
# 'resetStrategy': 'fastReset'
}
driver = Remote('http://your-winappdriver-server:4444/wd/hub', desired_caps)
Then you can sign in:
driver.find_element_by_id('UserNameTextBox').send_keys('username')
driver.find_element_by_id('PasswordTextBox').send_keys('secret')
driver.find_element_by_id('SignInButton').click()
In addition to the ID locator strategy used in this case, other locator strategies are also supported.
For your own store app, chances are that you have to test against the latest build comes from the CI system. In that case, just specify the URL to installation package, and even better the checksum for integrity checking.
desired_caps = {
'platformName': 'WindowsModern',
'app': 'http://your-build-server/path/to/your/pacakge.zip',
'packageName': 'your-app-package-name',
}
The package name should be declared in the name
field in the Identity
section of the package manifest file (package.appxmanifest.xml
). For example:
<Identity Name="Microsoft.CoolWindowsStoreApp" ... />
If you do not have the source code at hand, you can install it and try to figure it out by querying installed apps with the help of PowerShell cmdlet Get-AppxPackage
. Take Twitter app and the built-in store app as an example:
PS C:\> foreach ($app in Get-AppxPackage) { $app.Name }
Microsoft.VCLibs.120.00
Microsoft.VCLibs.120.00
Microsoft.WindowsCaculator
...
9E2F88E3.Twitter
winstore
Where you can find the package name of the built-in calculator is Microsoft.WindowsCalculator
, and obviously 9E2F88E3.Twitter
is the package name of Twitter app.
Please note that the value of this field is a generated GUID by default, and do not confuse it with the DisplayName
filed in the Properties
section.
For more details about the name of the package, please refer to Windows 8.1 Store apps: Contents of the package manifest.