|
以计算器为例录制了一个加法运算如下:
SystemUtil.Run "C:\WINDOWS\system32\calc.exe","","C:\WINDOWS\system32","open"
Window("Calculator").WinButton(“7”).Click
Window("Calculator").WinButton("+").Click
Window("Calculator").WinButton(“3”).Click
Window("Calculator").WinButton("=").Click
Window("Calculator").WinButton("C").Click
Window("Calculator").Close
在专家视图中对其进行参数化如下:
SystemUtil.Run "C:\WINDOWS\system32\calc.exe","","C:\WINDOWS\system32","open"
Window("Calculator").WinButton(Data Table.Value("num1")).Click
Window("Calculator").WinButton("+").Click
Window("Calculator").WinButton(Data Table.Value("num2")).Click
Window("Calculator").WinButton("=").Click
Window("Calculator").WinButton("C").Click
Window("Calculator").Close
并且将参数化后的对象都添加到对象库中,
运行后出现下面的问题:
The test run cannot continue due to a syntax error,
Expected “)"
Window("Calculator").WinButton(Data Table.Value("num1")).Click
小妹刚学QTP,不知道错误出在哪,哪位大侠能否指点一下啊,不甚感激啊 |
|