|
如何在录制好的脚本中使用变量来替代脚本中的物件名?请详细解答一下,不胜感激。
Function OpenPcm%()
dim iSqa%
dim iCall%
On Error goto errLb
OpenPcm=1
iSqa = SQAFindObject("\;Name=frmNConsole")
IF iSqa <> SQASuccess THEN
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读到变量中,我如何用变量来代替这部分? |
|