QTP/UFT-关闭除QC/ALM之外的所有浏览器 [英] QTP/UFT - Close all browsers except QC/ALM

查看:150
本文介绍了QTP/UFT-关闭除QC/ALM之外的所有浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在使用下面的代码关闭除我从中运行测试套件的ALM浏览器以外的所有浏览器.但是,当我从ALM运行套件时,以下代码标识2个浏览器-ALM浏览器和测试用例浏览器.它首先关闭测试用例浏览器,并在为ALM浏览器执行迭代时说,在尝试查找浏览器名称时未标识该浏览器.我不确定如果以后无法识别它,为什么将它计为浏览器.关于如何解决这个问题有什么想法吗?

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  

推荐答案

另一种选择是使用 ALM Explorer .

检查 此链接 更多信息.

Check this link for more information.

使用此功能,您无需担心会关闭任何浏览器.

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

这篇关于QTP/UFT-关闭除QC/ALM之外的所有浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆