| || |
Help required in PuTTY automation with UFT12.01 and TE add-in
This is my first post here.
>Hope this is right section for this topic
>I've searched in the forum with important keywords but the results did not help me
I'm using Win 7 64 bit VM for automation
UFT 12.01 with patch UFT00104
I'm required to log-in to linux server, execute certain commands, validate output and depending on validation result need to execute certain more commands.
To connect to Linux I'm using PuTTY
And for automating putty I'm using TE add-in.
I'm using shared repository where I've added "TeWindow" and "teTextscreen"
For your assurance I've correctly configured TE add-in. UFT recognizes it and types command too.
I've 18 functions that have similar flow,
Step 1>Launch PuTTY and log-in (this I'm doing from command prompt)
Step 2>Type certain Linux commands in the open window
Step 3>Analyze results
Step 4>Type "logout" in the window
Now, on individual execution this works flawlessly for all 18 functions, BUT in batch execution only first function works and for next function UFT throws error that "TeWindow" is not found in repository.
I've tried all possible solutions that I could think of but could not resolve it.
Please help me or at least show some light...
I don't know for sure, since I haven't ever used the TE add-in, but it sounds like one of the identifying properties of your window is changing after executing that first command. You might need to use a different property set to identify the window, or use regex in the properties you have to make it continue matching. Do properties show up in Object Spy for the window? If so, maybe pause the script after that first command and see if any important ones are different.
I'm using the terminal emulator "myExtra Enterprise" to simulate terminal mode VT-400 and it's very robust. It works whether batched or remotely triggered via Jenkins.
Are you closing the Purtty window or just logging out between tests in the batch?
Yes, I'm closing putty window (entering 'logout' command closes the window) after each function execution.
Originally Posted by mwsrosso
Why this approach : It helps me keep modularity for my scripts thus gives me freedom to execute any function at any time
Methods tried and failed:-
>Child object of desktop
>Ordinal identifier (location and index)
Only thing that I'm yet to try and won't try is "virtual object". I hate it!
I generally use plink which is a windows command line tool that is part of the putty suite. It allows you to run commands remotely on a linux or unix server from windows script host and return the response.
It looks something like this:
blic Function Unix_Run_Command (Host, User, Password,Command)
Set WshShell = CreateObject("WScript.Shell")
Command = Replace(Command,"''",Chr(34))
CMD = Chr(34 ) & Chr(34) & Parameter("RootPath") & "apps\plink.exe" & Chr(34) & " -ssh -pw " & Password & " " & User & "@" & Host & " " & Chr(34) & Command & Chr(34) & Chr(34)
Set oShell = WshShell.Exec ("%comspec% /C " & CMD)
Reporter.ReportEvent micDone, "Plink", "Using plink to run command: '" & Command & "' on Unix host '" & Host
Unix_Run_Command = oShell.StdOut.ReadAll
Set WshShell = Nothing
Had posted one in early morning today...it went for mod approval. Still not approved it seems.
b/w resolved the issue guys, thanx.
This is what I've done:-
>Made description object of class "window"
>Created all desktop objects Desktop.Childobjects
>My putty window has an unique name
>Searched the collection elements with the name
>When found, captured its "HWND" value
>By doing "setToProperty", assigned this value at runtime "TeWindow" properties
>Now my scripts are running without any issue !!!
i have used putty with QTP11.0 version with out the TE add-in and it worked fine. in btn i used extraputty
when things gets harder ,the harder gets going