wzero_ouyang 发表于 2014-3-24 14:27:38

有哪位大虾遇到过,QTP中,run脚本时,会自动弹出订票系统的页面,怎么设置关闭呢

脚本编写的是其他系统的,可是run的时候先弹出qtp自带的订票系统首页,然后才是我脚本里面的页面。怎么设置关闭订票系统页面?

脚本如下:
Dim ie
Dim bFind,bFindFour
Dim strURL
Dim t1,t2
Dim str

Const delayNum = 1
On error resume next
set ie = createobject("internetexplorer.application")
ie.Visible = true
ie.Silent = true

strURL = "http://192.168.1.248:9999"
ie.Navigate(strURL)

t1 = timer
Do while t2 - t1 < delayNum
                t2 = timer
Loop

services.StartTransaction "Login"
'账号登陆
ie.Document.getElementById("ctl07_UserName").value = "zhuzhengyu"
ie.Document.getElementById("ctl07_Password").value = "111111"
ie.Document.getElementById("ctl07_LoginButton").click

t1 = timer
Do while t2 - t1 < delayNum
                t2 = timer
Loop

'strURL = ie.Document.getElementById("UCUserLogin_Ma_Ac_05_lesp").Innertext
str =ie.document.documentelement.innerhtml
bFind = 0
bFindFour = 0
bFind = instr(1,str,"您目前的学分排名",1)
bFindFour = instr(1,str,"404",1)
If bFind <> 0 andbFindFour = 0 Then
        services.EndTransaction "Login",Pass
else
   services.EndTransaction "Login",Fail
End If

ie.Quit
Set ie = nothing

ermine 发表于 2014-4-11 15:08:27

Automation -> Record and Run Settings -> web -> Record and run test on any open browser

不要选择下面的那个
页: [1]
查看完整版本: 有哪位大虾遇到过,QTP中,run脚本时,会自动弹出订票系统的页面,怎么设置关闭呢