How to use WaitChild or WaitAliasChild when object name contains "Alias" already?
I am using jscript for TestComplete scripts and am struggling to figure out how to write a custom wait condition that will take an object as input and wait a specific number of seconds.
I have objects set up like this:
var button = Aliases.Product.Tab1.button
And in my scripts I use it like
button.click();
I want a new wait for exists function so I can write custom logging. I have tried
function WaitForConfigObjectExist(objectName, maxWaitTime) { var stopWatch = HISUtils.StopWatch; stopWatch.Start(); while(!Sys.WaitChild(objectName, 500).Exists) { Delay(500); var currentTime = stopWatch.Split(); if(currentTime > maxWaitTime) { Log.Warning(objectName + " not found after " + maxWaitTime + " seconds."); return false; } }
But I think this fails because System does not have a child called "Aliases.Product.Tab1.button". When I replace the while line with
while(!Aliases.WaitAliasChild(objectName, 500).Exists)
it complains that Aliases does not have a child with the name: Aliases.Product.Tab1.button
Short of changing the button to be "Product.Tab1.button" and using WaitAliasChild on that, is there any other option to check for existence of a generic object?
Thanks for any help!