Ask a Question

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

Azeddin_Margani
Contributor

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.

A.M.
4 REPLIES 4
Marsha_R
Community Hero

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

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
Contributor

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

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.

A.M.
Marsha_R
Community Hero

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

Try

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

Azeddin_Margani
Contributor

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

Hi, 

Do i need to declare the use of * anywhere in TestComplete because it tells me Unexpected Token *.

 

Azeddin_Margani_0-1634115040259.png

 

Thanks,

Az.

A.M.
cancel
Showing results for 
Search instead for 
Did you mean: