'执行过上面两句后,CurrentRow是第一行。
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Click 700,387
tempData0=DataTable.GetSheet("51sheet").GetParameter("username").Value
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Type tempdata0
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Click 717,424
tempData1=DataTable.GetSheet("51sheet").GetParameter("password").Value
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Type tempdata1
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Click 734,463
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Type "1111"
Do while Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").VirtualButton("button").Exist(0)
If tempdata0=null then Window("Microsoft Internet Explorer").Dialog("Microsoft Internet Explorer").WinButton("确定").click
'msgbox "username can't null."
else
Window("Microsoft Internet Explorer").WinObject("Internet Explorer_Server").Click 960,108
End If
Loop
loop
在do while 和IF之间成了死循环,我想在我所建的test.xls表中建立登陆的用户名和密码,在运行时分别获取username,password;
在功能测试时,要考虑到用户名或密码为空出错时是否有提示;我想用程序来实现,但不知道怎么做,就先试着编了上面的程序,确通不过,恼火,请各位高手多多指教,我第一次用QTP来编写脚本
注意:验证码把程序改了的,变成了固定的1111作者: qinxiaocang1202 时间: 2008-12-30 14:56 标题: datatable.getsheet Description
Returns the specified sheet from the run-time Data Table.
Syntax
DataTable.GetSheet(SheetID)
Argument
Type
Description
SheetID Variant Identifies the sheet to be returned. The Sheet ID can be the sheet name or index. Index values begin with 1.
Return Value
DTSheet Object
Example
The following example uses the GetSheet method to return the "MySheet" sheet of the run-time Data Table in order to add a parameter to it.
You can also use this to add a parameter to the "MySheet" local sheet (note that no value is returned).
DataTable.GetSheet ("MySheet").AddParameter "Time", "8:00"作者: qinxiaocang1202 时间: 2008-12-30 14:57 标题: datatable.setcurrentrow Description
Sets the specified row as the current (active) row in the run-time Data Table.
Note: You can only set a row that contains at least one value.
Syntax
DataTable.SetCurrentRow(RowNumber)
Argument
Type
Description
RowNumber Number Indicates the number of the row to set as the active row. The first row is numbered 1.
Example
The following example uses the SetCurrentRow method to change the active row to the second row in the global run-time Data Table.