List and ComboBox handled differently?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2010
11:31 PM
02-08-2010
11:31 PM
List and ComboBox handled differently?
I have two functions:
1)
function CloseActionHistory()
{
var strModuleID = c_strModule + CFGeneralUtilities.GetFunctionName(arguments.callee);
var viewer = Aliases.iexplore.pageViewer.panelViewerDocumentswf.objectViewerswf;
viewer.buttonHideActionHistory.Click(); //Hide the Action history
Sys.Refresh(); //Refresh the Object browser
oResult = !viewer.ComboBox(0).Exists;
CheckResult(oResult, "Action History did not close");
if(!oResult)
{
Log.Message("Action History closed upon click of Hide Action History button");
}
}
2)
function HideThumbnails()
{
var strModuleID = c_strModule + CFGeneralUtilities.GetFunctionName(arguments.callee);
var viewer = Aliases.iexplore.pageViewer.panelViewerDocumentswf.objectViewerswf;
viewer.buttonHideThumbnails.Click(); //Hide the Action history
Sys.Refresh(); //Refresh the Object browser
oResult = !viewer.List(0).Exists;
CheckResult(oResult, "Thumbnails widget did not close");
if(!oResult)
{
Log.Message("Thumbnails widget closed upon click of Hide Thumbnails button");
}
}
As you notice the only difference(other then the item names) is that the first oResult call in each funtion refers to 1) a ComboBox and 2) a List. The second function throws an error that it was "Unable to find the object List(0).".
Why are these exists calls treated differently?
1)
function CloseActionHistory()
{
var strModuleID = c_strModule + CFGeneralUtilities.GetFunctionName(arguments.callee);
var viewer = Aliases.iexplore.pageViewer.panelViewerDocumentswf.objectViewerswf;
viewer.buttonHideActionHistory.Click(); //Hide the Action history
Sys.Refresh(); //Refresh the Object browser
oResult = !viewer.ComboBox(0).Exists;
CheckResult(oResult, "Action History did not close");
if(!oResult)
{
Log.Message("Action History closed upon click of Hide Action History button");
}
}
2)
function HideThumbnails()
{
var strModuleID = c_strModule + CFGeneralUtilities.GetFunctionName(arguments.callee);
var viewer = Aliases.iexplore.pageViewer.panelViewerDocumentswf.objectViewerswf;
viewer.buttonHideThumbnails.Click(); //Hide the Action history
Sys.Refresh(); //Refresh the Object browser
oResult = !viewer.List(0).Exists;
CheckResult(oResult, "Thumbnails widget did not close");
if(!oResult)
{
Log.Message("Thumbnails widget closed upon click of Hide Thumbnails button");
}
}
As you notice the only difference(other then the item names) is that the first oResult call in each funtion refers to 1) a ComboBox and 2) a List. The second function throws an error that it was "Unable to find the object List(0).".
Why are these exists calls treated differently?
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2010
02:01 AM
02-09-2010
02:01 AM
All set. The solution was to add a waitchild statement into the exists statement so:
oResult = viewer.WaitChild("List(0)", 300).Exists;
oResult = viewer.WaitChild("List(0)", 300).Exists;
