|
'$Include "sqautil.sbh"
Sub Main
Dim Result As Integer
DIm x AS Integer
DIm dp AS long
Dim num,name1,tel,adrr,state AS String
Dim value1 As Variant
'Initially Recorded: 2004/7/20 と 11:07:33
'Script Name: test
dp=SQADatapoolOpen("dptest",FALSE,SQA_DP_SEQUENTIAL,TRUE)
For x=1 to 3
call SQADatapoolFetch(dp)
Window SetContext, "Caption=材蝗︽笆て砞称恨瞶╰参-ㄏノ腹 :[ admin ] - Microsoft Internet Explorer", ""
Browser SetFrame,"Type=HTMLFrame;HTMLId=Main",""
Delayfor (2000)
PushButton Click, "Type=PushButton;Name=btnAdd"
EditBox Click, "Type=EditBox;HTMLId=Pub_ID", "Coords=52,7"
call SQADatapoolValue(dp,1,num)
InputKeys "{HOME}+{END}{DELETE}"&num
EditBox Click, "Type=EditBox;HTMLId=Pub_Name", "Coords=8,13"
call SQADatapoolValue(dp,2,name1)
InputKeys "{HOME}+{END}{DELETE}"&name1
EditBox Click, "Type=EditBox;HTMLId=Pub_TEL", "Coords=56,14"
call SQADatapoolValue(dp,3,tel)
InputKeys "{HOME}+{END}{DELETE}"&tel
EditBox Click, "Type=EditBox;HTMLId=Pub_Address", "Coords=47,6"
call SQADatapoolValue(dp,4,adrr)
InputKeys "{HOME}+{END}{DELETE}"&adrr
PushButton Click, "Type=PushButton;Name=btnaddok"
Result = SQAGetProperty("Type=HTMLFrame;HTMLId=foot;\;Type=HTML;HTMLId=mnuBar1","innerText",value1)
call SQADatapoolValue(dp,5,state)
if value1<>state then
msgbox("warning")
end if
'msgbox(value1)
PushButton Click, "Type=PushButton;Name=btnaddcln"
next x
call SQADatapoolclose(dp)
End Sub
这是我以前写的一个关于抓去页面物件属性并与datapool中的值比较的脚本,没有加注释,而且时间太长了,也有些记不清GUI函数的具体内容了 ,所以楼主就自己参照Robot的帮助看看吧(PS:这是关于B/S架构的,至于楼主的VB小程序,我不是太了解,楼主可以尝试用rational自带的sample程序录制C/S架构的) |
|