UFT VB脚本(更新中)
2015-07-13 23:48
288 查看
On Error Resume Next
REM Msgbox(Err.Number)
REM Msgbox(Err.Source)
REM Msgbox(Err.Description)
REM ##############################################################################
SystemUtil.Run "C:\Program Files (x86)\Internet Explorer\iexplore.exe","","%HOMEDRIVE%%HOMEPATH%",""
Browser("百度一下,你就知道").Page("百度一下,你就知道").Sync
Browser("百度一下,你就知道").Navigate "http://www.baidu.com/"
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebEdit("wd").Set "UFT"
REM #点击按钮前,先检查对象存在性
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebButton("百度一下1").Check CheckPoint("百度一下")
If instr(Err.Description, "WebButton") > 0 Then
msgbox("按钮不存在")
Else
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebButton("百度一下").Click
End If
---------
REM #等待搜索结果&点击链接
wait(1)
Browser("百度一下,你就知道").Page("UFT_百度搜索#wd=UFT&rsv_spt=1&issp").Link("UFT/QTP11.5新特性 - TIB -").Click
msgbox(Actionname)
REM #网页是否存在
Browser("UFT/QTP11.5新特性 - TIB -").Page("UFT/QTP11.5新特性 - TIB -").Sync
If Err.Number<>0 Then
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebEdit("wd").Check CheckPoint("查询结果Link page未打开")
End If
Msgbox(Err.Description)
Browser("UFT/QTP11.5新特性 - TIB -").CloseAllTabs
Browser("百度一下,你就知道").Page("UFT_百度搜索#wd=UFT&rsv_spt=1&issp").Sync
Browser("百度一下,你就知道").CloseAllTabs
REM Msgbox(Err.Number)
REM Msgbox(Err.Source)
REM Msgbox(Err.Description)
REM ##############################################################################
SystemUtil.Run "C:\Program Files (x86)\Internet Explorer\iexplore.exe","","%HOMEDRIVE%%HOMEPATH%",""
Browser("百度一下,你就知道").Page("百度一下,你就知道").Sync
Browser("百度一下,你就知道").Navigate "http://www.baidu.com/"
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebEdit("wd").Set "UFT"
REM #点击按钮前,先检查对象存在性
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebButton("百度一下1").Check CheckPoint("百度一下")
If instr(Err.Description, "WebButton") > 0 Then
msgbox("按钮不存在")
Else
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebButton("百度一下").Click
End If
---------
REM #等待搜索结果&点击链接
wait(1)
Browser("百度一下,你就知道").Page("UFT_百度搜索#wd=UFT&rsv_spt=1&issp").Link("UFT/QTP11.5新特性 - TIB -").Click
msgbox(Actionname)
REM #网页是否存在
Browser("UFT/QTP11.5新特性 - TIB -").Page("UFT/QTP11.5新特性 - TIB -").Sync
If Err.Number<>0 Then
Browser("百度一下,你就知道").Page("百度一下,你就知道_2").WebEdit("wd").Check CheckPoint("查询结果Link page未打开")
End If
Msgbox(Err.Description)
Browser("UFT/QTP11.5新特性 - TIB -").CloseAllTabs
Browser("百度一下,你就知道").Page("UFT_百度搜索#wd=UFT&rsv_spt=1&issp").Sync
Browser("百度一下,你就知道").CloseAllTabs
相关文章推荐
- 【VBA研究】进入文本框后其内容全选
- VB课本总结
- VB前四章
- 一句话vbs下载
- vb.net Datagridview 下拉框应用
- 三种扩展 Office 软件功能的开发模型对比 – Office Add-In Model, VBA 和 VSTO
- vb.net操作word
- WPF(VB.NET) ImageSource 转 System.Drawing.Image
- VB的CRC32校验代码
- Excel VBA 不打开Excel文件访问其中内容的方法
- vagrant针对vb5.0的修改[z]
- opencv源码之一:cvboost.cpp
- vb6导出excel加速
- 【VBA研究】变量定义的类型和实际赋值类型
- AHA Demonstrates Complete DVB-S2X Modem in SDR Platform
- 【VBA研究】如何在if中判断一个值为null的变量
- uzgbtymhqo.vbs服务器端测试代码编写
- 实验室缉毒记之uzgbtymhqo.vbs
- 为什么很多病毒是用vbs写成的
- VB.NET中的DLL编写和调用的最简单示例