Switch to use different application or context
This article details how to switch the context to the specified process, object, or file using Genta Automation.
Introduction
Switch to a different application, web browser instance, datatable, file, or other process.
This command is very important for automations that involve multiple processes and/or files. It is needed to tell Genta what context it needs to work with. For example, switching from an Excel file to start inputting into a website would require a ‘Switch to’ command to tell Genta to start working with the website.
It is important to note the scenarios where ‘Switch to’ is not needed.
‘Switch to’ is NOT needed if you use any of the following commands as they automatically will get context of given process:
Navigate to
Create datatable
Open
Once one of the above commands is used, the context is automatically set to that process.
Syntax
Switch to $VARIABLE_NAME_HERE
Do not include spaces in the variable name or special characters.
Examples
The example syntax below will command Genta to switch from the web browser to Excel.
Prompt user "Please upload your excel file" $MyExcel -excel
//You can work with Excel by opening it to interact with the UI, or work with it while closed
Open $MyExcel
Navigate to "https://www.google.com"
//Do something
Switch to $MyExcel
//Do something
Fig. 2 shows the expected result for Example 1.