Appendix 10: Windows Application GUI Tutorial

Appendix 10: Windows Application GUI Tutorial



Appendix 10: Windows Application GUI Tutorial

Introduction

Process Studio Windows Spy is used for Windows Application GUI plugin, to extract Windows applications element attributes. 

Windows Spy is a compact toolbar and occupies minimum screen area so that one can spy on a Windows application with ease. Upon spying it opens a Generate Step Window that has two sections – Attributes table and Step Generation. 


Shortcut/Hot Keys

Following are the shortcut keys available for Windows Application GUI plugin.

  1. Ctrl + Alt + X – To open Windows Spy. Windows Spy Interface opens as seen below. Notice that the background of lens is black color which signifies that the windows spy is not in active mode. Click on the lens icon.



  1. The background of the magnifying lens changes to white color which signifies that Spy is in active mode and you are ready to spy. 



  1. A notification is shown when the spy goes in active mode. Hot keys are mentioned in notification text.



  1. ‘Shift’ or ’ ~ ’  will get information of that element on which mouse is present (Hovering) at that moment.
  2. Close any active Windows Spy by clicking ( )or ( with Ctrl+Q).
  3. All Windows elements can be detected using Windows Spy.
  4. Now hover over the element to Spy. Press keyboard key ‘Shift’ or ‘~ ’.  



Windows Spy Best Practices

Following are the best practices while selecting criteria for element detection

  1. It is recommended to detect elements with criteria having element index 0 (i.e. unique elements). Avoid using element index greater than 0 (e.g class name in snapshot below). Select the element having the element index as 0.  
  2. If some criteria are dynamic then use criteria for which criteria value is constant (such as, If Absolute XPath or AutomationID are dynamic use criteria- Name if its value remains constant). Absolute XPath is best for constant application structure and dynamic element names. 
  3. Use All criteria, every time if you have an application with no window name or if a spy doesn’t provide any absolute XPath or element index. 
  4. While generating step or editing step, with critera All, replace any non-consistent criteria value with a blank value.



Windows Spy Workarounds 

Following are Windows Spy workarounds,

1. If element index below snapshot is null/not working then in criteria select All.


    1. If while trying to detect an element it gives a red border user can design step by copying windows path and criteria values from a different configuration of the same step or another step where the element is detected with a blue border.  
    2. In mouse click suppose there are limited Action in the drop down, you may copy the windows path and criteria value and manually create the step on the element with desired Action.
    3. In Mouse action In case drag drop is not working you may use the Set Value step.  
    4. We cannot use Windows Action, on pop-up windows, instead we can use Mouse Action- Click, or Surface plugin– surface Click or robot handing.
    5. In case Get Table Data is not working you may use Get Value step in a loop to fetch the table data row by row.





Windows Spy from Toolbar 

You may start Windows Spy from Process Studio toolbar or else using Shortcut/Hot keys as discussed in the section above. This opens Spy that can generate any Windows Application GUI step.

Following ate the steps to generate a step,


  1. Add a new folder to Spy project.





  1. Name the folder Windows Spy.



  1. Navigate to ToolsSpyWindows Spy to open Spy. 

  1. If there is no active workflow respond to the warning message to create a new workflow.



  1. Select the project in which to create the workflow.




  1. We shall leave the default name for the workflow Workflow_1.




  1. Windows Spy toolbar opens as seen at the bottom right in the screenshot below.
  2. If the lens on the toolbar has a dark background then Spy is inactive mode, else with a white background it is in active mode.



  1. Click the lens in the Windows Spy toolbar. The background of the lens on the toolbar changes to white. You are now ready to start spying.   



  1. Now hover over the element to Spy. Press keyboard key ‘Shift’ or ‘~ ’.  
  2. Element is highlighted in blue color as seen that the notepad writing pane is highlighted in blue. 
  3. You can also see that the Generate step window is opened with configurations as seen below.   


  1. You may change the Step and Action from the drop down list. Provide a Step Name. Windows Path for the application is also populated. 
  2. Pressing ‘Generate’ Button adds a new step to workflow with action and relevant data for the step as provided.  
  3. The Step list in window “Generate Step” above changes as per the element detected.

It simply depends on type of action it supports. E.g. let say element detected is of type textbox. So it has step list – Element Action, Set Value, Get Value, Mouse Action. While for element of type checkbox step list is Element Action, Mouse Action.

  1. Also actions in Action list changes from type of element to other.
  2. We shall change configurations to Set Value. Click Generate.

 


  1. Step [Set Value] generated and added to workflow message appears as seen below.  



  1. Set Value step is generated as seen below. Double click to open the configurations window.



  1. You may click Highlight to highlight the element. We can see that Notepad Writing pane is highlighted below.   



Windows Spy from Step

Spy can be started from step dialog in most of the Windows App GUI plugin steps. In this section we will start Windows Spy from the plugin step. 

Note: it is recommended to use windows Spy from Step to edit existing step rather than creating new similar step from other applications.

  1. Let us continue with the Set Value step we generated in the previous section. Double click the step to open the configuration window as seen below. Close any active Windows Spy by clicking ( )or ( with Ctrl+Q).



  1. Click on any of the configuration items to enable the Edit Element button. Click on Edit Element to start Spying.



  1. Opening spy with Edit Element button from a step is restricted to the step. Step is not editable as seen above and only relevant elements to the step are detected from active spy. We can call it as a ‘Step Restricted Spy’ for example,
    1. Suppose spy is started from ‘Set Value’ step. Now spy is restricted to elements that support Set Value in the same or other applications. However it is recommended to use Windows Spy from Step to edit the existing step configuration only. Supported elements will be highlighted with blue border and the rest with a red border.
    2. Suppose spy is started from ‘window action’ step. Now spy is restricted to elements of type ‘Window’ only. All element of type ‘window’ will be highlighted in blue color. If we try to detect element other than of type ‘Window’ it is highlighted in ‘Red’ color.


  1. You may use Hotkeys to detect elements. Pressing ‘Shift’ will help us know if element is supported for the step. Let us see the various scenarios in the following examples,
  1. Spy the writing pane of Notepad. You can see it is highlighted in blue as seen below.



  1. Hover over an icon of Microsoft Edge to Spy. Since no value can be set here, it is not compatible with Set value step. Hence it is higjhlighted in red as seen below.



  1. In the screenshot below a section of another application ManicTime is highlighted with a red box.



  |



  1. The outer window of Notepad is also highlighted in red as it is not compatible with Set Value step.



  1. The name in the header of Notepad can be changed upon saving. It is compatible with Set value step and hence is spied and highlighted in blue.



  1. Certain title test in Manic Time application is compatible with Set Value step and hence highlighted in blue.




  1. This completes a high level tutorial of Windows Spy. 

Note:Refer Project 8: Spy and Folder Windows Spy in AutomationEdge_Process_Studio_Getting_Started_Guide_R6.0.0 for a sample workflow using Windows Spy.






      Links to better reach 

            Bot Store

             EPD