Scaling in Windows can behave differently based on the affected application. This can cause inconsistencies in workflows that deal with UI automation, especially those which contain activities with the CursorPosition and ClippingRegion properties, such as Click, Hover, Type Into, Click Text, and others. However, this only applies to workflows created with a Studio version prior to 2018.2. Workflows created prior to this version need to be migrated with the ScaleCoordinates tool to be executed by DPI-aware Robots (v2018.2).
In order to provide the required flexibility to efficiently use old workflows with 2018.2, the ScaleCoordinates tool can migrate either individual or all workflow files inside a given path. No changes need to be made to workflows created prior to Studio 2018.2 if executed with DPI-aware Robots, as well as with new workflows you want to execute with Robots that are not DPI-aware after using this tool.
Use the ScaleCoordinates migration tool on UI automation workflows designed at a non-standard DPI, in a version of Studio prior to v2018.2. Workflows created at a regular DPI do not require a migration to be executed on DPI-aware Robots.
Regardless of the type of migration you want to perform, you first need to:
- Open a Command Prompt instance.
- Navigate to the UiPath Platform installation directory, where the ScaleCoordinates migration tool is located.
- Use one of the following commands:
UiPath.ScaleCoordinates <input_xaml_file_path> <output_xaml_file_path> (--normalize_from | --denormalize_to)=<scaling_percentage>to migrate a single
UiPath.ScaleCoordinates <folder_path> (--normalize_from | --denormalize_to)=<scaling_percentage>to migrate all projects inside a particular folder.
Keep in mind that you can normalize workflows to be executed in Studio 2018.2, as well as to adapt a normalized project to work with old Robots on a non-standard DPI. Below are examples of these situations for both a single and multiple projects.
Let’s assume that you need to use an existing workflow, such as
ProcessingInvoicesInSAP.xaml, at 150% scale percentage on DPI-aware Robots. The workflow is designed in a Studio version older than 2018.2, therefore it needs to be normalized to run at the specified scale percentage by using the following command:
UiPath.ScaleCoordinates C:\Accounting\Automations\ProcessingInvoicesInSAP.xaml C:\Accounting\Automations\NormProcessingInvoicesInSAP.xaml -normalize_from=150
The migrated workflow is exported in the
C:\Accounting\Automations folder under the
NormProcessingInvoicesInSAP name. The original workflow file is not removed upon migration. The
NormProcessingInvoicesInSAP workflow can now be executed at 150% scale percentage, on DPI-aware Robots (v2018.2).
Now let’s say you want to migrate multiple workflow to be executed at 150% scale percentage. Running the command above on multiple files is a tedious task, so it’s recommended to use the command which migrates files from an entire folder. If the files you need to migrate are in the
C:\Accounting\Automations directory, and want them to be executed at 150% scale factor, then the command looks like this:
Batch normalizing does not export the workflow files to an output folder, which means that files in the specified folder are replaced. It is recommended to create a backup first.
UiPath.ScaleCoordinates C:\Accounting\Automations -normalize_from=150
All the files in the
C:\Accounting\Automations directory can now be executed at 150% scale percentage by DPI-aware Robots (v2018.2).
Since 2018.2 Robots are DPI-aware, the DPI at which workflows are created in Studio 2018.2 does not affect workflow execution. However, executing them at a non-standard DPI on older Robots can cause inconsistent element detection. To prevent this, you can use the ScaleCoordinates tool to migrate the workflows to run at a specified scale percentage on old Robots.
Just like normalizing workflows, denormalizing can be performed either on a single workflow file or multiple ones found in a specified path.
Assuming that you designed the
ProcessingInvoicesInSAP.xaml workflow in Studio 2018.2 and want to run it at 150% scale percentage on DPI-unaware Robots, the following command needs to be used to migrate the workflow:
UiPath.ScaleCoordinates C:\Accounting\Automations\ProcessingInvoicesInSAP.xaml C:\Accounting\Automations\DenormProcessingInvoicesInSAP.xaml -denormalize_to=150
DenormProcessingInvoicesInSAP.xaml workflow is now ready to be executed at 150% scale percentage on Robots prior to the 2018.2 version.
Similarly, multiple workflows meeting the same design conditions can be migrated to be executed at 150% scale percentage on DPI-unaware Robots. Remember that the original files are overwritten, so be sure to create a backup before migrating them. The necessary command, in this case, looks like this:
UiPath.ScaleCoordinates C:\Accounting\Automations -denormalize_to=150
Now, you can execute the workflow files in the
C:\Accounting\Automations directory on DPI-unaware Robots at 150% scale percentage.
Updated 11 months ago