07-01-2008, 03:26 PM
mmhhh... i don't believe to can use the same way. I interact from QTP to SSH client defining objects and passing text strings + enter, in this way:
i.e. QTP uses SSH client as ... ehm... a monkey worker :-)
Now the variable "esist" will be =0 or <>0 according to the existence of file.log, but only on this SSH client, not in the script... i can't use "esist" in if-statements... i would need something similar to getroproperty to capture the value of "esist" inside a QTP variable... as:
[I know it's impossible because object spy doesn't see the value of 'esist']
Is it possible in some other way or it can't be return in QTP from other applications? maybe i should do a ftp from machinexyz to my pc with SSH client, then create an object with Scripting.FileSystemObject...
sorry for post length and thanks
Code:
dim crt, conn, tree, butt, finestra
set crt = Window("regexpwndtitle:= SecureCRT", "index:=0")
set conn = crt.Window("regexpwndtitle:=Connect", "index:=1")
set tree = conn.WinTreeView("regexpwndclass:=SysTreeView32")
set butt = conn.WinButton("regexpwndtitle:=&Connect")
SystemUtil.Run "C:\Programmi\SecureCRT\SecureCRT.EXE"
tree.Select "Sessions;BEA_BE;machinexyz"
butt.Click
crt.Activate
Set finestra = crt.WinObject("regexpwndclass:=AfxFrameOrView42")
wait(5)
finestra.Type "cd /path_log"
finestra.Type micReturn
finestra.Type "esist=`du file.log | cut -b -1`"
finestra.Type micReturn
i.e. QTP uses SSH client as ... ehm... a monkey worker :-)
Now the variable "esist" will be =0 or <>0 according to the existence of file.log, but only on this SSH client, not in the script... i can't use "esist" in if-statements... i would need something similar to getroproperty to capture the value of "esist" inside a QTP variable... as:
Code:
dim exist
exist=finestra.getroproperty(esist)
Is it possible in some other way or it can't be return in QTP from other applications? maybe i should do a ftp from machinexyz to my pc with SSH client, then create an object with Scripting.FileSystemObject...
sorry for post length and thanks