QTP中登陆脚本的设计

上一篇 / 下一篇  2010-12-27 14:01:16

Dim str,MyArray ,Msg
Browser("test").Page("test").Frame("topFrame").WebEdit("name").Set DataTable("Name", dtGlobalSheet)
Browser("test").Page("test").Frame("topFrame").WebEdit("name").Set DataTable("pwd", dtGlobalSheet)
Browser("test").Page("test").Frame("topFrame").Link("登录").Click
if(Browser("test").Dialog("Microsoft Internet Explorer").Exist) then
str = Browser("test").Dialog("Microsoft Internet Explorer").GetVisibleText
'假设系统提示信息为“请输入帐号!”,则“GetVisibleText ”这个函数返回的值是:
'Microsoft Internet Explorer
'请输入帐号!
'确定
MyArray = Split(str, vbcrlf , -1, 1)
'MyArray(0) =Microsoft Internet Explorer
'MyArray(1) =请输入帐号!
'MyArray(2) =确定
str = MyArray(1)
datatable.Value("result",dtGlobalSheet)=str
Browser("test").Dialog("Microsoft Internet Explorer").WinButton("确定").Click
Else
Browser("test").Page("test").Frame("topFrame_2").Link("退出").Click
end if

TAG:

 

评分:0

我来说两句

日历

« 2024-05-13  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 15036
  • 日志数: 23
  • 建立时间: 2010-11-05
  • 更新时间: 2012-02-18

RSS订阅

Open Toolbar