Migrating Robots from Windows to Linux#
Key Points of Migration #
When migrating a robot from Sherpa Designer in Windows and Linux environments, several important aspects should be considered. If a block is present in Sherpa Designer for both Windows and Linux, no additional actions are required for its migration. The blocks function in PowerShell, which operates the same on both platforms. All classes and functionalities implemented in the robot for Windows are transferred to the Linux environment unchanged.
However, it should be noted that Word and Excel COM objects will not work on Linux-like systems. During migration, it is necessary to check the "Properties Panel" for all blocks related to Word and Excel and uncheck the checkbox: . After the user clears the "Use COM" checkboxes, the Word and Excel blocks in the Linux environment will function correctly.
Differences in File Paths#
When working with Linux, it is important to note that file paths have a different format, using a forward slash.
Examples of path separator designations:
- In Linux-like systems, a forward slash is used: /home/user/documents/file.txt
- In Windows, a backslash is used: C:\Users\User\Documents\file.txt
However, absolute paths (such as C: or D:) will not function. Use standard methods to determine the current working directory, such as `[Environment]::CurrentDirectory`. This will allow you to accurately determine where your code is located and help correctly form relative paths. A relative path indicates the location of a file relative to the current working directory. For example, if the current directory is:
/home/user, then to access the file file.txt in the documents directory, you can use: documents/file.txt.
Recording Selectors in Browsers and Applications#
Regarding recording selectors, the same plugin is used in Yandex Browser/Chromium in the Linux environment as in Windows. It is sufficient to install the plugin following the instructions in the section Installing the Plugin in Yandex Browser.
If the application supports the at-spi (Assistive Technology Service Provider Interface) technology, the robot will work with it directly through selectors, just like in the Windows environment.
Robot Functionality#
There are some limitations related to Sherpa Designer Blocks available in the Linux environment:
| Block Category | Blocks Not Available in Linux |
|---|---|
| UI Automation | ClickOnText CopyToClipboard PasteFromClipboard CollectData SelectOption DragAndDrop HighlightElement ClearCache ControlCache GetGridData |
| Browser Automation | CopyToClipboardInternet PasteFromClipboardInternet |
| HTTP | InternalBrowserRequest GetYandexLinks GetGoogleLinks InternalAsyncBrowserGet |
| SAP Automation | SAPCreateConnection SAPCloseConnection SAPConnectConnection SAPSelectWindow SAPClick SAPPressEnter SAPDoubleClick SAPSelect SAPUnSelect SAPState SAPCollapse SAPExpand SAPGetText SAPSetText SAPColumnCount SAPRowCount SAPCount SAPSapEvent SAPExportTable SAPImportTable SAPGetCellValue SAPSetCellValue SAPCurrentDate SAPSelectRange SAPElementExists SAPPressF4 SAPHScroll SAPVScroll |
| Dialogs | ManLoop MediaPlayer |
| Excel Automation | FindTextExcel |
| Outlook Automation | GetOutlookMailMessages SendOutlookMailMessage ReSendOutlookMailMessage SaveAttachmentsFromOutlookMessage SaveMailFromOutlookMessage GetOutlookFolders MoveOutlookMessage ExtractEmailFromOutlookMessage LoadMsgFile ReplyOutlookMailMessage ChangePropertiesMailFromOutlookMessage |
| Exchange Automation | GetExchangeMailMessages SendExchangeMailMessage ReSendExchangeMailMessage SaveAttachmentsFromExchangeMessage SaveMailFromExchangeMessage MoveExchangeMessage ReplyExchangeMailMessage |
| Clipboard | GetClipboard SetClipboard SetFilesClipboard |
| Process/Service | ListServices StartService StopService SetServiceStartupType GetWindowState SetWindowState SetWindowLanguage SetWindowPosition AttachApplication |
| Terminal Automation | TerminalConnectSession TerminalCloseConnection TerminalGetCursor TerminalMoveCursor TerminalGetTextPosition TerminalGetFieldPosition TerminalSetTextPosition TerminalSetFieldPosition TerminalGetField TerminalSetField TerminalGetScreenArea TerminalSendKeys TerminalSendControlKey TerminalWaitTextPosition TerminalWaitFieldPosition TerminalGetFieldBetween TerminalSetFieldBetween |
| Registry | ReadValueFromRegistry WriteValueToRegistry ListitemsFromRegistry CreatePropertyInRegistry RemovePropertyInRegistry CreateHiveInRegistry RemoveHiveInRegistry |
| 1C Automation | 1CCreateConnection 1CCloseConnection 1CExecuteQuery 1CExecuteCode 1CCollectData 1CTableCellClick 1CCheckboxControl |
| RDP | RDPGenerateConnection RDPCreateConnection RDPConnectInstance RDPCloseConnection RDPDisconnectSession RDPOperationFile RDPRunScript |
| Windows Credentials | SetWindowsCredentials GetWindowsCredentials DeleteWindowsCredentials GetCyberArkCredentials |
| Machine Learning | RegressionTrain RegressionPredict ClassificationTrain ClassificationPredict ClusterTrain ClusterPredict AnomalydetectionTrain AnomalydetectionPredict AssistantGenerator |
Some features, such as PiP (Picture-in-Picture) mode, which allows users to view videos or other visual materials in a small window that remains on top of other applications or windows, are not available in Linux, as this is a Microsoft technology.
Template Engine in Linux#
In Linux systems, the Template Engine block works fully. However, if it is necessary to modify the template file, this can only be done in the Windows environment. This is because the Template Engine for Linux is still under development. Currently, some editors, such as Word and specialized tools for designers, use editing features that are temporarily unavailable in Linux. After making changes to the template file in the Windows environment, it will be necessary to create or update a JSON file to reflect these changes in the Template Engine for Linux. After that, the JSON file is uploaded to the system using commands or APIs specific to your environment.
Web Page Elements#
When migrating robots, there may be issues with processing selectors for images, as the robot will not find the images.
In Sherpa Designer, four image recognition methods are used (the "Comparison Type" field):
- SQDIFF (Squared Difference) - this method calculates the squared difference between the pixels of two images. The smaller the value, the greater the similarity between the images;
- CCORR (Correlation) - this method uses correlation to assess the similarity between images. It gives the best results when the images have the same lighting and contrast;
- CCOEFF (Correlation Coefficient) - this method measures the degree to which two images can be matched based on the correlation coefficient, normalizing the results by their averages;
- NATIVE (default) - this method is preset and is used for quick comparisons using built-in algorithms based on platform features.
If the NATIVE method does not work, it is recommended to use SQDIFF, as Linux-like systems do not have the bitmap of the window image available in Windows.
It is also important that the recording location of the controls matches the screen resolution and color depth; otherwise, the images may be scaled, and the robot will not be able to find them.