QTP获取浏览器的一些常用属性的方法
2008-01-07 17:45
302 查看
获取浏览器的一写属性的方法:
Dim obj,tempValue
'获得窗体对象
set obj = 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)
Dim obj,tempValue
'获得窗体对象
set obj = 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)
相关文章推荐
- Windows批处理中获取文件属性的一些方法
- jQuery中一些不常用的方法属性【转载】
- 总结的一些jquery获取更改dom元素常用方法
- UITextField一些常用属性和方法
- 原生js获取浏览器窗口及元素宽高常用方法集合
- Ext.form.ComboBox最常用的一些属性和方法
- Java String类 字符串的一些常用方法 --获取
- java 获取日期的前N天的日期以及Calendar类的常用方法常用属性
- XML中的一些常用属性和方法
- IOS中一些常用的获取设备信息的方法
- javascript常用方法、属性集合及NodeList 和 HTMLCollection 的浏览器差异
- 自己重新实现QTP封装的一些常用的方法
- 常用方法、属性集合及NodeList 和 HTMLCollection 的浏览器差异
- HTML常用的获取页面属性方法总结(HTTP/HTTPS/request)
- DevExpress中关于GridControl控件的一些常用属性设置方法
- js获取浏览器高度 窗口高度 元素尺寸 偏移属性的方法
- 兼容浏览器的获取指定元素(elem)的样式属性(name)的方法
- SlidingMenu使用方法和常用的一些属性设置
- 兼容浏览器的DOM对象自定义属性获取方法
- jQuery和js一些标签属性的获取和修改方法以及区别