QTP获取浏览器的各种属性

上一篇 / 下一篇  2015-03-23 10:07:48

Dim obj,tempValue
 '获得窗体对象
set bj = Browser("CreationTime:=1").Page("index:=").Object.parentWindow
 '获取浏览器的当前语言。
tempValue = obj.clientInformation.browserLanguage
print(tempValue)
 '获取浏览器的名称。
tempValue = obj.clientInformation.appName
print(tempValue)
 '获取浏览器运行的平台和版本。
tempValue = obj.clientInformation.appVersion
print(tempValue)
 '获取用户的操作系统名称。
tempValue = obj.clientInformation.platform
print(tempValue)
 '获取操作系统适用的默认语言。
tempValue = obj.clientInformation.systemLanguage
print(tempValue)
 '获取浏览器的代码名称。
tempValue = obj.clientInformation.appCodeName
print(tempValue)
 '获取指示 CPU 等级的字符串。
tempValue = obj.clientInformation.cpuClass
print(tempValue)
 '获取表明系统是否处于全局脱机模式的值。
tempValue = obj.clientInformation.onLine
print(tempValue)
 '获取等同于 HTTP 用户代理请求头的字符串。
tempValue = obj.clientInformation.userAgent
print(tempValue)

TAG: QTP

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-16  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 58183
  • 日志数: 34
  • 图片数: 1
  • 建立时间: 2011-09-26
  • 更新时间: 2017-02-28

RSS订阅

Open Toolbar