Search

How to create an RPA flow using Send Hotkey activity to access M3 popup

Overview

The Send Hotkey activity in the RPA Studio allows you to send the keyboard shortcuts to an UI element. By simulating keystrokes and keyboard shortcuts, you can streamline processes and interact with applications efficiently.

In the M3 web application, users can navigate to a specific screen by running a transaction code. For example, after logging into the M3 app and pressing CTRL+R, a Search and Start control appears. By entering the transaction code MFS100, users are directed to the Internal Invoice.Create screen.


Components

  • RPA
    • RPA Management
    • RPA Studio
  • M3 application (target application in our example)

Requirements

You need to install the latest version of RPA Studio on your machine:

  • Download the connection files
  • Download RPA Installer from RPA Management. For this tutorial you need to install:
    • IDE Studio
  • Establish a connection between the RPA Studio and the RPA Management
  • You can check the Infor RPA Studio User Guide for the details

Pre-requisites

  • Target Application: Ensure the application or window is active and in focus.
  • Key Identification: Know the exact keys or key combinations required.
  • Modifier Keys: Understand how to configure and use modifier keys (Ctrl, Alt, Shift).
  • Application State: Verify the application is in a state to accept the hotkey input.
  • Timing: Be aware of any required delays between key presses.
  • Error Handling: Implement error handling for potential hotkey failures.

Tutorial

Difficulty: Medium
Estimated completion time: 25 Minutes

1. Open RPA Studio

Open RPA Studio on your machine, and sign in, if required.

2. Create a new project

On the Home page click Create New Project and specify the following properties in the pop up window:

  1. Name: M3HotKey
  2. ProjectLocation: <default>
  3. Description: Demo on M3 HotKey
  4. Language: VB <selected by default>

3. Model the login steps

First we need to model the steps to login into the tenant navigating directly into M3 Home Screen. For the steps on login into the tenant follow the tutorial: How to create an RPA Flow using the Get Microsoft OTP Code to login to Infor Tenant.

Note: You may want to skip particular steps which are not required in your tenant setup like generation of the OTP code for login and double check the XPATH.

Alternatively, you can import the provided OTP.xaml into this project by importing and unzipping the project from How to create an RPA Flow using the Get Microsoft OTP Code to login to Infor Tenant. Then right-clicking on the name of the Project inside of the project panel and selecting import file.

4. Start building the flow

Next we move on to the MainPage.xml. We then add the Invoke Workflow activity. You can find the list of activities by clicking Activities in the left-hand side bar or from the View menu in the top bar. Use search to find the activity you want.

Configure the activity in the following way:

  • For the Input Arguments
    • Create 3 arguments of type string named: UserLogin, Password, URL with appropriate default values.
      • Note: to simplify the setup the name of the arguments should be same as in the OTP.xaml
  • Click on the Invoke Workflow activity and define the Input Arguments as followed: New Dictionary (Of String, Object) from {{“URL”, URL}, {“UserLogin”, UserLogin}, {“Password”, Password}}
    • this means that the value of the URL, UserLogin, Password argument will be passed to the subflow
  • For the Workflow File create the variable called SubWorkflow with default value of the OTP.xaml workflow path “….\OTP.xaml“ Note: that the OTP.xaml workflow must be part of this specific project
  • For Output Arguments create the variable called Dictionary of type iDictionary<String, Object> (Browse for types/System.Collections.Generic.IDictionary<TKey, TValue>)

5. Check the variables in the imported OTP.xaml

Go to OTP.xaml sequence to validate that you have 3 arguments called: URL, UserLogin and Password with Direction IN without the default values. The values will be passed from the Main sequence.

6. Model the M3 steps

After Invoke Workflow allows us to log into the M3 application, you can model the steps to access the M3 Search and Start panel open while using the “CTRL + R“ hotkey. First, you need to use the To IFrame activity to switch to an iframe, as the target elements are located within it. Configure the activity in the following way:

  • for Wait After let’s add 2000, it means that the bot will wait 2000 MS after executing this activity
  • for Input specify the following Xpath value “//iframe[contains(@name, ‘m3h5_’)]”

Now, use the Send Hotkey activity to send the keyboard keys “CTRL + R” to the M3 application which will allow the bot to open the “Search and Start“ dialog window. For that let’s configure the activity in a following way:

  1. for Wait After specify 5000
  2. for Wait Before specify 5000
  3. for Modifier select CTRL
  4. for Key type “+ R”
  5. for XPath specify “/html/body”

When the “Search and Start” control appears, bot should click the input text box within this control. For that add Web/Click activity, and for XPath specify “//input[@id=’search-and-start-autocomplete’]”

You can also rename the Click activity to “Click search-and-start-autocomplete”

Next we should model the step to send the required program code value (e.g.MFS100) to this input text box. We can do that by using the Send Keys activity. For Key specify the program code e.g. “MFS100“.


Finally, you should model the step where the bot clicks the ‘OK’ button on the “Search and Start” control. For that use the Click activity and configure it in the following way:

  • For Wait After add 3000
  • For Xpath specify “//button[@id=’oc-btn-ok’]”

7. Execute the Flow

Now you can save your flow. Click Run to execute and verify that the user is navigated successfully to the required Invoice Creation screen in the M3 application.