A new version of Qualitia Automation Studio for Web and Mobile 7.2.x is now available. We highly recommend you upgrade. Find more details here.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


Objects

Objects are keys for understanding Test Automation. Objects are nothing but the controls used in the application.
In the figure shown below, you can see 'Username'. It is an object called 'Label'. Text box below 'Username' is another object called as 'TextBox' or 'WebEdit'. Similarly you can also see other objects like 'check box' as well as 'button' (Sign in).

Every object type has a unique functionality and accordingly they are classified in different categories. Following are the commonly used objects:

Object Attributes

In general, an attribute is a property or characteristic. Color, for example, is an attribute of your hair. In your application under test, an attribute is a changeable property or characteristic of the control, which can be set to different values.
In the real world, you will find many examples of objects: Car, computer, mobile phone, or bicycle. Real-world objects also share characteristics. Car has color, model, company name, horsepower (hp).
Similarly, objects in software applications also have attributes. It is important to know the attributes of an object and its role in test automation.
Following are few of the commonly referred attributes in functional test automation.

  • Name
  • ID
  • Class

Let us take an example:

Here 'Sign in' is an object of type button and it has following attributes with associated values of the attributes:

  • Name: Sign in
  • Color: Blue

Selection of Attributes

Object may have multiple attributes and identifying a unique set of attributes and its associated value is most fundamental success criteria for your test automation tool to identify a particular object uniquely every time during test automation.
For example, consider the following html page.

The above page has two identical text boxes. If you need to use only first text box in our test automation, you should use a particular attribute such that its value is unique and your automation tool is able to point to this particular object.
In this example, first text box has value attribute = val1. You may make use of value attribute in this case. However, it may not be as simple as it appears above, if the value attributes changes for some reason during the next iteration of testing.

Static and Dynamic Objects

Static Objects

Static object is the one for which the value of attribute does not change. For example, value of colors property of Indian National Flag will never change.
Best practices in identifying Static Object:
Out of all the attributes, the most static attribute known is the 'name' attribute. Next is the 'id' attribute as id's can change, since there are few development frameworks that dynamically generate values for id attribute. For all such applications, 'id' attribute becomes the most dynamic.

Dynamic Objects

Dynamic object is the one for which the value of attribute is prone to change. For example, value of size property of Indian National Flag can change.
Best practices in identifying Dynamic Object:
To identify an object, never select an attribute that has a dynamic value. Look for any other attribute(s), which are expected to remain static and points to the desired object uniquely. If there are no such attributes, try to use 'regular expression' to avoid dynamism. This is possible if the attribute value has some static and some dynamic portion. You can even parameterize the value to take a complete control of predictable dynamism.
There are cases where dynamisms of attribute values are not predictable. Do not use such attributes.

  • No labels