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.

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
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) 

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
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: