51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2330|回复: 1
打印 上一主题 下一主题

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

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2014-3-24 14:27:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
脚本编写的是其他系统的,可是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 and  bFindFour = 0 Then
        services.EndTransaction "Login",Pass
else
   services.EndTransaction "Login",Fail
End If

ie.Quit
Set ie = nothing
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2014-4-11 15:08:27 | 只看该作者
Automation -> Record and Run Settings -> web -> Record and run test on any open browser

不要选择下面的那个
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-6-3 22:15 , Processed in 0.083079 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表