Ask a Question

dynamic object names

ch5082
Occasional Contributor

dynamic object names

I have just started the evaluation of TC yesterday.  I'm having problems with a few controls that names with each iteration.

Here is an example:  Afx2 changes to Afx3.

Aliases["pmlaunch"]["frmConversation"]["vsvViewPort_2"]["picPictureBox_2"]["AfxOleControl42"]["Afx2"]["Edit"]


Aliases["pmlaunch"]["frmConversation"]["vsvViewPort_2"]["picPictureBox_2"]["AfxOleControl42"]["Afx3"]["Edit"]



Is there some way to use a "wildcard" in the object name?


2 REPLIES 2
chris_adair
Occasional Contributor

I have used the '?' wildcard for the specific characters that change in the object/window name.  You may also be able to use '*' as well.



I have a command for WaitWindow:



WaitWindow("Afx:????????:8:000?????:00000000:00000000", "", 1,-1);



Since anywhere that has the '?' changes each run time.  This works most of the time for me.



HTH!

Hi Chuck,


As you are using aliases, I recommend that you use the WaitAliasChild method instead - it allows masking variable parts of aliases with wildcards. Please see the "WaitAliasChild Method" help topic ( http://www.automatedqa.com/support/viewarticle.aspx?aid=3833 ) for more information.



Best regards,
Alexey

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: