White Library tutorial for windows application automation

Image
 Quick overview Pr-requisites Reference to the keywords Basic script Conclusion Pr-requisites: Python Robot framework  White library  Make sure you have below mentioned are already installed on your system. Reference to the keywords  If you need to know how to use robot framework - check this blog White Library keywords - click here How to find element locators so we can use them in this automation Basic script *** Settings *** Documentation                   Notepad automation using WhiteLibrary. Library      WhiteLibrary *** Variables *** ${APPLICATION_LOCATION}    C:/Windows/notepad.exe *** Test Cases *** Open Notepad And Create A File Launch Application ${APPLICATION_LOCATION} Sleep 3s #wait time to notepad launch Attach Window Untitled - Notepad Input Text To Textbox text=Text Edito...

How to use Accessibility Insights to locate elements on windows applications

 In short



  1. Download and install the application
  2. Use inspector to locate the target element
  3. Check different properties
  4. Limitations


Download and install the application

  • Visit the official website and download the application for windows

            website - Accessibility Insights for windows

  • Open the application, here is how it looks, there are 3 important sections we need to know here-

    1. Inspect On/Off button
    2. Elements section
    3. Properties section

Accessibility Insights-



Use inspector to locate the target element

  1. Open the target application that you want to inspect elements for automation.
  2. Move the mouse to the element which you want to inspect. Say. The text area section where we can write the content.
  3. When you see the inspector box(blue border) covers the full element, move the mouse pointer quickly to the accessibility insights window to capture the property for the element.



Check different properties

Here you can see many properties in the properties section, most useful are as below-
    • Automation Id
    • Name
    • Help Text
    • Class Name
    • Control Type
You can notice the orange arrow in Elements section, it says that currently element under inspection. 
The same time you will find the element related properties in the properties section.
I have highlighted couple of the properties here-
  1. AutomationId
  2. ClassName
Copy the value of the properties for the element and note them for the future reference. As we can use these properties for automation purpose.
Example.
  • For AutomationId =15, we will use id=15 (in the automation script)
  • For ClassName=Edit, we will use class_name=Edit.
  • For Name=Edit, we will use text=Edit
  • For HeltpText=EditButton, we will use help_text=EditButton
Example of the automation script statement-
Click Item                           text=Edit
Input Text In Textbox         id=15
Wait Until Item Exists        class_name=Edit
You can refer our blog on the whitelibrary using which we can automate the windows applications.

Additional settings-
If Automation Id or any other property is not visible in the properties section, here is the way to get it visible/enabled.
  1. Once you have the inspection element correctly selected in the Elements Section.
  2. You can click on the settings icon, and select the option "Include all the properties that have value"
  3. You can select some specific values by selecting the second option from the settings, and I will leave it for you to do the hands on.
  4. Now you can see all the properties that have values for a particular element.
Hope it helps!

Popular posts from this blog

White Library tutorial for windows application automation