1

Currently I am using the below code to close all the browsers except the ALM browser from where I run the test suite from. However When I run the suite from ALM, the below code identifies 2 browsers - ALM browser and the test case browser. It first closes the test case browser and when it executes the iteration for the ALM browser, it says the browser is not identified when it tries to find the name of the browser. I am not sure why it counts it as a browser if it cant identify it later. Any thoughts on how to resolve this?

 Dim oBrDes  
 Dim oBrObjList  
 Dim objIndex  

 Set oBrDes=Description.Create  
 oBrDes("micclass").Value = "Browser"

 Set oBrObjList=Desktop.ChildObjects(oBrDes)  
  N = oBrObjList.count-1 
 For objIndex=0 to N 
  If(oBrObjList(objIndex) is nothing) then
  'Do Nothing
  Else
  name = lcase(oBrObjList(objIndex).GetROproperty("name"))
  If (Instr(1,name,"quality center") <> 0 or Instr(1,name,"automatic runner") <> 0 or name <> "") then  
   value = oBrObjList(objIndex).getroproperty("visible")
   If(trim(value) <> "True") then
   'Do Nothing
   Else
            oBrObjList(objIndex).close  
    End If
   End If  
   End If
 Next  

 Set oBrObjList=Nothing  
 Set oBrDes=Nothing  
TheBlastOne
  • 4,291
  • 3
  • 38
  • 72

2 Answers2

2

Another option is to use ALM explorer.

Check this link for more information.

By using this you do not need to worry about closing any browser.

ManishChristian
  • 3,759
  • 3
  • 22
  • 50
1

In Tools ⇒ Options ⇒ GUI Testing ⇒ Web there is an Ignore ALM checkbox, this may be interfering with the Browser identification. Try setting/unsetting this checkbox and see if this solves your problem.

Motti
  • 110,860
  • 49
  • 189
  • 262
  • Well I guess I typed it too fast. It only works if I run the test case from UFT. It doesn't when I run from ALM. In both cases the automatic runner window is opened. Only difference being Automatic runner window is idle in the former and executing the case in the latter – Enthusiastic Learner Aug 18 '15 at 03:57