Forum Discussion

Azeddin_Margani's avatar
Azeddin_Margani
Contributor
4 years ago

How can i shorten long object name (using TC 14).

Hi, 

 

Please advise on how can i shorten a long object id as below as it dynamically changes : 

Sys.Browser("chrome").Page("https://uat.testenviroment-test.com/customers/").Panel("portal").Panel(0).Panel(0).Panel(0).Panel(2).Panel(1).Panel(0).Panel(0).Panel(0).Panel(1).Panel(0).Panel(1).Panel(0).Panel(0).Button(0)

 

Tried to use wild card (*) but getting red cross against the same line. The idea is to tell TestComplete to ignore what is after wild card *.

 

Many Thanks. 

Az.

  • You don't say which part changes, but I'm going to go with the URL being stable.  I would define a variable with a short name to be equal to your URL string and then use the variable in the page name.

    • Azeddin_Margani's avatar
      Azeddin_Margani
      Contributor

      Hi Marsha, 

       

      The part that keeps changing is highlighted in blue: 

      Sys.Browser("chrome").Page("https://uat.testenviroment-test.com/customers/").Panel("portal").Panel(0).Panel(0).Panel(0).Panel(2).Panel(1).Panel(0).Panel(0).Panel(0).Panel(1).Panel(0).Panel(1).Panel(0).Panel(0).Button(0) 

       

      Please provide with illustrative example in here. 

      I would like to achieve 2 things if possible: 

      1. To shorten this object id. 

      2. To use a wild card on the these panels as they keep changing. 

       

      Many Thanks, 

      Az.