Forum Discussion

HealthAutomate's avatar
HealthAutomate
Occasional Contributor
9 years ago
Solved

Click action based on Object property

Hi There, 

 

Hope you can help me with a solution as I am quite new to TestComplete.

 

I am using a keyword test where the script is being run across two environments. I am trying to achieve below points.

 

  1. To run same script across both environment based on object property. 
  2. Use if statement to perform the action based on its value.

Eg: Environment1 has a link with an image as Item[104] but Environment2 has a link with an image as Item[107], this is because one environment has more link than the other one and its location is slightly changed. 

 

Ideally I want to do something like below: 

 

Find object value first.

 

If (ObjectValue =104)

    Click 104

else 

    Click 107

 

Appreciate any help and guidance.

 

Thanks

 

 

 

  • Hi,

     

    You can do a conditional name mapping for your object. Like a:

     

    Aliases.YourObject :: YourObjectProperty == "104" or "107"

     

     

1 Reply

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    You can do a conditional name mapping for your object. Like a:

     

    Aliases.YourObject :: YourObjectProperty == "104" or "107"