请斑竹详细解答以下sqabasic中的连接自窜
如何在录制好的脚本中使用变量来替代脚本中的物件名?请详细解答一下,不胜感激。Function OpenPcm%()
dim iSqa%
dim iCall%
On Error goto errLb
OpenPcm=1
iSqa = SQAFindObject("\;Name=frmNConsole")
IF iSqa <> SQASuccessTHEN
SQAShellExecute "C:\Program Files\PCMConsole\PCMConsole.exe","",""
iSqa = SQAWaitForObject("\;Name=frmNConsole",20000)
IF iSqa <>SQASuccess THEN
SQALogMessage sqaFail, "无法开启pcmconsole", "初始化"
Goto errLb
END IF
Window SetContext, "Name=frmNConsole", ""
Window SetPosition, "", "Coords=0,0,247,553;Status=NORMAL"
TreeView Click, "Name=TreeView1;\;ItemText=vantechsoft->nanjing", ""
ELSE
iSqa = SQAFindObject("\;Name=frmLogin")
IF iSqa <> SQASuccess THEN
Window SetContext, "Name=frmNConsole", ""
Window SetPosition, "", "Coords=0,0,247,553;Status=NORMAL"
Window MoveTo, "", "Coords=4,0"
TreeView Click, "Name=TreeView1;\;ItemText=vantechsoft->nanjing", ""
iSqa = SQAFindObject("\;Name=frmLogin")
IF iSqa <> SQASuccess THEN
Window SetContext, "Name=frmNConsole", ""
Window SetPosition, "", "Coords=0,0,247,553;Status=NORMAL"
Window MoveTo, "", "Coords=4,0"
MenuSelect "工具(T)->重新登入(G)"
end if
end if
end if
iCall = logon("a","a")
if iCall =0 then Goto errLb
Exit Function
红色的部分可以用sqagetproperty读到变量中,我如何用变量来代替这部分? 楼主是不是想先得到一个属性,然后存在变量里,在以后的动作语句中使用这个变量来定位对象
如果是的话参考
http://bbs.51testing.com/viewthread.php?tid=15571&fpage=1&highlight=%B1%E4
页:
[1]