Forum Discussion

syalamanchili's avatar
14 years ago

Modified Script Not running until the events are recorded

Hello, I am testing a .Net application using TestComplete 8.60.665.7



This application has some popup messages with Yes or No buttons, and the code recorded for these buttons changes for every new build as shown below.



Build 5.7.0.1700:

Aliases.CNG_Safe_Management.dlgCNGManagement7501700.btnNo.ClickButton



Build 5.7.0.2000:

Aliases.CNG_Safe_Management.dlgCNGManagement7502000.btnNo.ClickButton



So, I am searching and replacing string 'dlgCNGManagement7501700'  for every new build accordingly.



The Problem is, for some buttons it doesn;t work giving the below error

 Unable to find the Object btnNo. See Additional Information for Details



This error goes away if i record this button click action. script generated from recording is exactly the same, but somehow recording this action at least once is making this error go away.



Can you please let me know  how to fix this issue as this is forcing me to rerecord for every new build.



I am also attaching a screen shot of my application with popup message.

1 Reply

  • Hi,


    The problem is that the CNG Management dialog is mapped by using properties that are changed from one application build to another. I guess, you use the WndCaption property as an identification property for the object that corresponds to the CNG Management dialog, but the dialog caption is different for different builds. As a result, the problem occurs.


    In this case, you can use wildcards to make mapping settings independent of changes in the dialog caption. For example, you can use the asterisk (*) wildcard in place of dynamic values. Actually, you can set the WndCaption identification property's value to CNG-Management *.


    For more information on how to modify identification properties, please see http://smartbear.com/support/viewarticle/12451/.

    For information on using wildcards, please see http://smartbear.com/support/viewarticle/18943/.