Forum Discussion
agabriel
10 years agoContributor
I've solved this issue via a different means. I did not want to just hide the log entry but actually prevent the problem from occurring. Some experimentation and I found that adding a delay would in some cases provide enough time for the window to 'recreate' itself...the problem is that there is no finite delay time that worked reliably.
So my solution was to create a function that would wait until the object is visible before interating with it.
The function:
function WaitFor(_propertyNames ,_propertyValues)
{
var PN = _propertyNames;
var PV = _propertyValues;
var Depth = 1000;
var Refresh = true;
Log.Message("Waiting for Property '"+PN+"' and '"+PV+"' to become visible...");
while(!Aliases.BrowserWindow.Find(PN, PV, Depth, Refresh).Visible){
//Wait until the object is visible before proceeding
}
Log.Message("Property is visible");
}
To use it, I just call on the function immediately before the action I want to perform:
var PropNames = new Array ("propertyname1", "propertyname2");
var PropValues = new Array ("propertyvalue1", "propertyvalue2");
WaitFor(PropNames, PropValues);
Aliases.BrowserWindow.Find(PropNames, PropValues, 1000, True).Click();
So my solution was to create a function that would wait until the object is visible before interating with it.
The function:
function WaitFor(_propertyNames ,_propertyValues)
{
var PN = _propertyNames;
var PV = _propertyValues;
var Depth = 1000;
var Refresh = true;
Log.Message("Waiting for Property '"+PN+"' and '"+PV+"' to become visible...");
while(!Aliases.BrowserWindow.Find(PN, PV, Depth, Refresh).Visible){
//Wait until the object is visible before proceeding
}
Log.Message("Property is visible");
}
To use it, I just call on the function immediately before the action I want to perform:
var PropNames = new Array ("propertyname1", "propertyname2");
var PropValues = new Array ("propertyvalue1", "propertyvalue2");
WaitFor(PropNames, PropValues);
Aliases.BrowserWindow.Find(PropNames, PropValues, 1000, True).Click();
Related Content
- 7 years agogdave