Chinaunix首页 | 论坛 | 博客
  • 博客访问: 742673
  • 博文数量: 769
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4985
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:37
文章分类

全部博文(769)

文章存档

2011年(1)

2008年(768)

我的朋友

分类:

2008-10-15 16:44:35

              Set book = excel.Workbooks.Open("Your Book1.xls")
             Set worksheet = book.Worksheets("Your Excel sheet's name")
             For count=1 To 2
             s_name = worksheet.Cells(1,count).value
             s_pass = worksheet.Cells(2,count).value
             'print s_name,s_pass
             Window SetContext, "Caption=Web应用系统 - Microsoft Internet Explorer", ""
             Browser SetFrame,"Type=HTMLFrame;HTMLId=mainframe",""
             Browser NewPage,"HTMLTitle=Title",""
             EditBox Click, "Type=EditBox;Name=userAccount", "Coords=26,10"
             InputKeys s_name &"{TAB}"&s_pass
             PushButton Click, "Type=PushButton;HTMLText=登录"
             Window SetTestContext, "Caption=Web应用系统 - Microsoft Internet Explorer", ""
             Browser SetFrame,"Type=HTMLFrame;HTMLId=mainframe",""
             Window SetTestContext, "Caption=Microsoft Internet Explorer", ""
             Result = LabelVP (CompareProperties, "Text=输入错误,请重新输入!", "VP=Object Properties;ExpectedResult=FAIL")
             Window ResetTestContext, "", ""
             Next count
             'Quit Excel'''''''''''''''''''''
             excel.Quit
             Set excel = Nothing
             Window CloseWin, "", ""
         End Sub
--------------------next---------------------

阅读(531) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~