Forum Discussion
jose_pita
12 years agoSuper Contributor
I don't use name mapping, I always use the same function to click any object with parameters such as objectPropertyName and objectPropertyValue accepting arrays too (just did this in a hurry, can have some mistakes)
function waitForObjectAndClick(objectPropertyName, objectPropertyValue, maxTime)
{
//maxTime is in seconds
if(maxTime == undefined)
maxTime = 5
var obj,counter;
counter = 0;
while(!obj.Exists || obj == null || obj == undefined)
{
obj = sys.browser.page.find(objectPropertyName,objectPropertyValue, 30, true);
delay(1000);
counter++;
}
if(counter==maxTime)
{
Log.Error("UPS!");
Runner.Stop();
}
}