QTP中将Action测试输入参数化之后,调用Action时传入的参数可以用外部Excel文件导入吗
比如RunAction "Action1 ", oneIteration,"UserName","Password"用户名和密码是要调用的时候输入的,但是我有很多组值要输入,把这些值都放到外部的Excel文件中,怎么调用呢 :'(我非常需要帮助 Dim MyExcel,OpenWord,OpenSheet,btn_str
Set MyExcel=CreateObject("Excel.Application")
Set OpenWord=MyExcel.Workbooks.Open("E:\数据.xlsx")
Set OpenSheet=OpenWord.Worksheets("Sheet1").UsedRange
msgbox OpenSheet.Cells(1,1)
msgbox OpenSheet.Cells(1,2)
msgbox OpenSheet.Cells(1,3)
msgbox OpenSheet.Cells(2,1)
msgbox OpenSheet.Cells(2,2)
msgbox OpenSheet.Cells(2,3)
MyExcel.DisplayAlerts=True ' 弹出的警告,点yes
Set OpenSheet=Nothing
OpenWord.Close(True) '保存修改的值
MyExcel.Quit 用 datatable.importsheet 只需要在当前datatable中新建一个 sheet,然后导入外部excel
datatable.addsheet("localsheet")
datatable.importsheet("filepath","excel中的sheetname","datatable中的sheet")
页:
[1]