Skip to content
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.Flowcharts is retired. Current docs
Get Free Trial
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.

Windows Desktop Automation

This section details how to test Windows Desktop Applications. If you are not familiar with Sahi Pro Flowcharts, see Introduction to Sahi Pro Flowcharts To automate windows desktop applications using Sahi Pro Classic, refer Windows Desktop Automation.

  • Start Sahi Dashboard

  • Click Processes link on Sahi Pro Dashbord. Ensure that Windows Automation is turned on. “Sahi windows agent started!” message appears on Sahi Pro console.

  • First we need to create a Flowchart. If you are not familiar with creating a flowcharts, see Create a Flowchart

  • To launch Flowcharts Controller, visit the Flowcharts window. Click on the dropdown arrow next to Launch and then select Open Controller.

  • Click on any node of the flowchart and select Automate.

  • From the Automate dialog, click on the window icon

    The Controller can be used to interact with the desktop application. You can Identify, Click, Set, Assert, choose Other Actions on the Windows Desktop application.

  • Launch the Flowcharts Controller and click on any node of the flowchart and select Automate.

  • In the Automate dialog, click on the Windows button. This enables the identification for Windows automation.

  • To identify an element, press the CTRL key, hover over any element and release the CTRL key.

    .

  • To automate a Windows application, you would start recording actions on the application. However, Windows automation allows you to automate on the entire system screen. Thus, actions performed on other applications, Taskbar, Windows Start Menu, etc. also get recorded. To ignore such actions, restrict recording and identification to a specific application process, follow below steps:
    1. In the Automate dialog, expand the dropdown for the Windows button. It lists the processes that are running in the system. Hovering over a process name will display all the window titles it encompases. Select the process name to restrict the Windows automation.

      Select window for restricted identification

    2. Note that the provision to add this restriction is also available in the Flowcharts Controller.

      Select window for restricted identification

This is similar to automating a Sahi Pro Flowcharts keyword for normal browser testing.- To automate a Keyword in WINDOWS mode, Window icon at the top left of the Automate dialog must be clicked during identification or automation and click on Start Record button. Actions done on the Windows Desktop application are recorded automatically.

  • Steps can also be recorded from the Flowcharts Controller.

  • A. You can use Click, Set, Assert, choose ‘Other Actions’ to perform an action on the Windows Desktop Application.

    B. You will need to record these steps explicitly by clicking on ‘Add Step’.

  1. On the Automate dialog click on Runbutton.

    Click on Run

  2. The Run Settings dialog opens. Select the Mode Windows if we did not mentioned in the scipt and click RUN.

    Run options

  1. Click on the Reports button..

    Click on Report button

  2. The Report opens in a new browser tab.

    Report

  • To start a Windows application from flow, use Execute inbuilt action.

  • All code interactions with Windows will need to be preceded by Set Mode inbuilt action and Application Type as WINDOWS.

  • Execute Faster by Ignoring Hidden and Disabled Elements

    • While searching for an element during Playback, Sahi internally iterates through all the elements on the application screen. At times, this iteration may be slower for few screens in your application. This iteration can be made faster by adding below properties to the userdata.properties file as applicable.

      // Add below property to ignore hidden elements in your application
      sahi.desktop_automation.windows_automation.ignore_hidden_elements=true
      // Add below property to ignore disabled elements in your application
      sahi.desktop_automation.windows_automation.ignore_disabled_elements=true
  • Enable Identifying Inner Elements

    • In some applications, inner elements may not be identified from the Sahi Controller. Lets say a pane element contains child elements like textbox, button, etc and the child elements are not getting identified from Sahi Controller. To fix this, find the entry for the parent element type in <Sahi_Installation>\config\accessor_metadata\mswindows.json file. Add a new key “deepSearchAlgo” with value as “child” in this entry for the parent element type.

      For example, the key “deepSearchAlgo” can be added for a pane element as shown below.

      {"type": "pane", "name":"_pane", "id":"50033", "deepSearchAlgo":"child", "attributes": ["name", "automationId", "helpText", "className", "index"], "action": "setValue", "value" : "transform", "assertType":"TEXT", "since": ["NA", "NA", "NA", "7.0.0"]}