Desktop-web customization service
Limitations
The feature is currently:
-
Supported only on Windows Fast Web configurations
-
Not supported on Mac Desktop-Web devices
Service overview
To pre-configure the Desktop-Web VM, you can use the the Desktop-Web Customization Service (DCS). This services has been generated for automation testing, with resources supplied from a repository of artifacts.
The configuration of the VM is performed based on a "playbook" that includes YAML instructions of what configuration operations, for example install certificates, download artifacts, application executions, to perform prior to executing the automation script.
DCS is called as part of the Selenium execution, under the control of the DesiredCapabilities, and executes the playbook instructions on the generated VM accessing files stored on Perfecto's cloud storage. When the playbook instructions are complete, the automation script is activated on the Desktop-Web VM in the proper environment.
Use the DCS
Using the DCS involved preparing the playbook, uploading files, and specifying the DCS in relevant automation scripts.
Click a task to view its steps.
The playbook is a YAML file that follows a syntax similar to the Ansible playbook syntax. This syntax allows the playbook to run commands in a Windows cmd window using the win_shell module. Sample playbook files can be found in the Ansible git repo.
Playbooks for DCS should define the hosts to be all (at start of playbook). The actual host is dynamically determined by DCS.
- name: Configure Fast Web VM hosts: all
Perfecto supplies a small set of prepared playbook files:
Playbook Name | Description |
---|---|
pm-self-signed.yml | Install certificates (previously uploaded to the Perfecto cloud-based repository, as below) onto the Desktop-Web VM |
pm-upload-files.yml | Upload files (previously uploaded to the Perfecto cloud-based repository, as below) onto the Desktop-Web VM. Files will be located at C:\Temp on the VM "disk storage". |
These can be customized for the particular customer's use case. Alternatively, a custom-playbook can be prepared for the user.
The playbook execution may access files that need to be transferred to the VM during the DCS processing. The files are stored in a partition for the particular customer in a Perfecto, cloud-based, repository. These files will be uploaded by Perfecto Support for the customer.
The DCS feature introduces the following new Selenium driver Capabilities:
- customizationScript - identifies the playbook used to configure the Desktop-Web environment. Playbook file should be located in the customer's partition in the Perfecto cloud repository and should be in the format described above.
- customizationScriptArgs - arguments supplied to the playbook. The arguments should be supplied as a Java Map format. The playbook supports two arguments:
- timeout - defines the timeout for completion of the customization. Integer value indicates the number of seconds [default value: 90 sec]
- fileslist - a list of String names of artifacts that playbook accesses.
The following snippet uses the capabilities to identify the playbook and supply a list of files and a new timeout:
Map<String, Object> resourceArgs = new HashMap<>();
resourceArgs.put("timeout", 120);
myfiles = new String[]{"arg1", "arg2", "arg3"};
resourceArgs.put("fileslist", myfiles);
capabilities.setCapability("customizationScript", "MyPlaybook.yml");
capabilities.setCapability("customizationScriptArgs", resourceArgs);
For a full sample, see the sample in GitHub that pre-loads a set of certificates to the Desktop-Web machine.
Troubleshooting
DCS may report the following error indicators in various situations:
- Timeout exceeded - if the customization process requires a longer time than the configured timeout (default 90 sec, see above customizationScriptArgs) - the error message will appear in the execution report as:
WFA-500-0156 – “Customization script timeout exceeded” - General playbook error - reported in various situations, for example - file not found, YAML syntax error. The error message will appear in the execution report as:
WFA-500-0157 – <text describing the exact error>