The post Chapter 4 – Object String | Webdriver appeared first on TestMate.
]]>Object String is a string that is used to identify an automation object based on its attributes and hierarchy. In a Webdriver, we have following locators to identify an object:
The object string for webdriver has the following format:
<Locator>::valueThe object string for the search button on google will be “name::btnG” e.g. wd.Click “name::btnG”
Nested objects are the child objects which lie under some parent object. The object string for the nested object has the following format:<Locator(Parent)>::value>==><Locator(Child)>::value
e.g. “name::Parent>==>id::child”
When the object string points to more than one object then we can use the concept of index.
e.g. wd.Click “name::btnG,index::1”
Note: index starts from 0
The post Chapter 4 – Object String | Webdriver appeared first on TestMate.
]]>The post Chapter 3 – Object String | UIA appeared first on TestMate.
]]>Object String is a string which is used to identify an automation object based on its attributes and hierarchy in a particular application. Any tool can be used for object identification, ‘Microsoft Inspect’ is the recommended tool. (You can download it for free from Microsoft’s website. It also comes bundled with windows SDK)
The object string has the following format:
<Control Type>,Property::value>==><Control Type>,Property::value
Example: Consider the windows calculator as a sample application and Inspect as an object spying tool.
(Finding object string for ‘%’ button below)
Step 1:
Control Type = Window & Name = Calculator
Object string here for the outer window will be
“Window,Name::Calculator”
Step 2:
Going down in hierarchy we again have :
Control Type = Window & Name = Calculator
So the object string for the inside window will again be:
“Window,Name::Calculator”
Combining both the strings we have:
“Window,Name::Calculator>==>Window,Name::Calculator”
Step 3:
Control Type = Button & Name = Percent
The object string for the inside window will be:
“Button,Name::Percent”
Combining all the strings we have:
“Window,Name::Calculator>==>Window,Name::Calculator>==>Button,Name::Percent”
Now various actions can be performed on this button like click , doubleclick etc..
uia.Click “Window,Name::Calculator>==>Window,Name::Calculator,index::1,>==>Button,Name::Percent”
e.g. “Button,Name::Percent,AutomationId::percentButton”
Index can be used in the cases where two elements have same properties.
e.g. “Button,Index::1”
Regular expressions can be used for objects with dynamic properties. It can be applied by adding ‘r|’ as a prefix to the property value.
e.g. “Window,Name::r|Cal.*”
If the control type is not known then a generic control type can be used as below:
e.g. “Object,Name::Calculator” Here ‘Window’ is replaced by ‘Object’.
Smart algorithm tries to find the element based on the other properties and ignores the control type. It can also be useful in the case when the actual application is not available.
The post Chapter 3 – Object String | UIA appeared first on TestMate.
]]>The post Chapter 2 – Reserved Objects appeared first on TestMate.
]]>To facilitate quicker automation a few objects have been reserved as below:
Upon typing the object name, all the methods in its class will be displayed in IntelliSense. You can select any method from it and mouse over it to get all the available overloaded methods and more help.
The post Chapter 2 – Reserved Objects appeared first on TestMate.
]]>