Ask a Question

List and ComboBox handled differently?

llaskin
Occasional Contributor

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 REPLY 1
llaskin
Occasional Contributor

All set.  The solution was to add a waitchild statement into the exists statement so:



oResult = viewer.WaitChild("List(0)", 300).Exists;  

cancel
Showing results for 
Search instead for 
Did you mean: