51Testing软件测试论坛

标题: 大家帮我看一下,我这里为什么不能循环呀? [打印本页]

作者: gantangyu    时间: 2005-5-23 15:11
标题: 大家帮我看一下,我这里为什么不能循环呀?
'$Include "sqautil.sbh"
Sub Main
    Dim Result As Integer
    Dim  varstr As string
    dim  dp  as long
    dim  dp_id as  integer
    dim  usd as string
    dim  psd as string
   
   
    'Initially Recorded: 2005-5-23  10:45:31
    'Script Name: test
  StartBrowser "http://192.168.18.19:8082/login.jsp", "WindowTag=WEBBrowser"

   for dp_id =1 to 2
   
   'dp=SQADatapoolOpen("test", FALSE, SQA_DP_SEQUENTIAL , True)'打开数据池
   dp =SQADatapoolOpen("test")
   call SQADatapoolFetch(dp)  '从数据池读取记录
  
   Call SQADatapoolValue(dp,"username",usd) '将从数据池中读取的数据赋予相应变量
  
   Call SQADatapoolValue(dp,"password",psd)

   Window SetContext, "WindowTag=WEBBrowser", ""
  
   Browser NewPage,"HTMLTitle=xxxxxxx有限公司",""
   
   EditBox Click, "Name=loginName", "Coords=61,5"

  ' InputKeys usd&"{TAB}"&psd&"{ENTER}"
   InputKeys psd
   EditBox Click, "Name=loginPass", "Coords=17,7"
   InputKeys usd
   HTMLImage Click, "Index=3", "Coords=35,9"

   Browser SetFrame,"Type=HTMLFrame;HTMLId=left",""
   
    Browser NewPage,"",""
   
    HTMLLink Click, "Type=HTMLLink;HTMLText=工作日志", ""
   
'   HTMLLink Click, "Type=HTMLLink;HTMLId=menu;Index=13", ""
   
    Result=SQAGetProperty("Type=HTMLFrame;Name=left;\;Type=HTMLTable;Index=1","innerText",varstr)
   
    SQAconsoleWrite str(varstr)
   
   next dp_id
   
     Call SQADatapoolClose(dp)
   
     Window CloseWin, "", ""

End Sub

执行的时候怎么只是在用户名文本框中挨着输入两个admin,然后提示输入密码,很奇怪,这到底是那出错了呀?:,(
作者: pcl2004_27    时间: 2005-5-26 03:03
楼主的问题 我已经回答了应该!把答案揭晓吧!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2