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) |