Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unix commands
#1
Not Solved
Hi,
from QTP I have launched a SSH Client where I use unix commands. Here I create a variable: how can I use this variable out of unix commands, as QTP variable?
ex:
Code:
...
finestra.Type "dimensione=`du file.log | cut -b -1`"
finestra.Type micReturn
...
If dimensione = "0" Then
   ....
Else
   ...
End If


Thanks
Reply
#2
Not Solved
Are you able to record the commands from QTP. If no, what are the add-ins you are using.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
yes I am able to write commands and obtain expected results from QTP. My problem is that I define a variable with a certain value inside shell, but I would use this value also outside the shell, so that I can use the Reporter object with classic If conditions. Is it possible?

Thanks
Reply
#4
Not Solved
that is what my point is how are you interacting with shell application...how are you passing inputs to it...the same way can't you extract output from it?
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#5
Not Solved
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:

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)
[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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP commands ullas.ns 1 4,627 10-25-2012, 01:44 PM
Last Post: silpavinod
  QTP List of Functions and Commands rpc86 4 11,091 01-10-2012, 06:31 PM
Last Post: deepaksporty
  QTP execute REST XML Commands neerukonda9 0 3,217 11-03-2011, 10:53 PM
Last Post: neerukonda9
  How to verify data from UNIX file syhusain 1 3,295 05-19-2011, 10:48 AM
Last Post: deepaksporty
Toungue QTP recording the unix application zhuorulin 1 3,083 03-02-2011, 05:06 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)