Skip to content

Identify dynamic UI Object

UI Objects are one of the most crucial parts of building a successful automation project. Some of them are static (do not change at all) and some of them are dynamic (they are dependent on some dynamically changing parameters).

Dynamic objects are a bit trickier to deal with than static objects, but it is not as difficult as it may look, there is an akaAT’s way to handle parameterized objects.

3.1.1. Apply data in Object’s variable

3.1.1.1. Apply data in Object's variable using loop

  • Step 1: Enter variable name in “Variable” tab of UI Object

image-20220606131042807

  • Step 2: Write in locator to find element and put value variable into Locate Value through the character $.this.varName

image-20220606131106374

  • Step 3: Create a test case and call the test object and pass the value to the set variable location

image-20220606131119751

image-20220606131128711

​ - Once an Object is called in the test case, the variable of Object displays in the “Variable” tab of the test case as shown in image below.

​ - You can input the value of the variable here or leave it blank and go to Step 4.

image-20220606131139422

  • Step 4: Create a data file and associate the dynamic XPath with the values in the table

image-20220606131149210

  • Step 5: Set Data source into a For Statement

image-20220606131157581

  • Step 6: Set value to Object variable in test case by Value in Data column (use syntax: $.DATA.dataFileName.dataColumn)

image-20220606131214336

3.1.1.2. Apply data in Object's variable using index

We can call variables from test data in columns and rows if we want to use a row in test data. (use syntax: $.DATA.data1.[0][1])

applydataByIndex

applydataByIndex1

3.1.2. Apply Global variable’s value in Object’s variable

  • Step 1: Create Global Variable

image-20220606131224113

  • Step 2: In test case, set object variable’s value = Global variable value

image-20220606131236417