One way we did it was to open a telnet session making sure the window size and font was constant. Then we attached to the window and did type commands with events waiting on screen based on the text provided in the telnet session. We also used this for DOS windows also.
"What about getting the text between the command I typed and the prompt. In other words, how do I get the output of the command I typed in the telnet window?"
OK, first off I'll appologize if this is a little off base since it's been a year and a half since I've used QARun... but as I recall:
The best luck I had performing this same task was to drive the telnet window to a specific location and resize it so the script will be able to use the coordinates of the telnet window and to know the size of the text retuned.
Next, use syncronization to slow the script down and allow the telnet session to respond. (I usually synchronize on a known state of the app - with telnet this is a bit more difficult since QARun only scrapes the telnet screen and doesn't understand where the cursor is).
To get around this, type in your command and hit return. Then type in "!!" (without the quotes) and synchronize off of those "!!"
That way, you'll know when the command has been executed and the output has been returned in the telnet session and telnet is ready to continue.
Once there, simply have the script delete the "!!" and enter in the next command.
To return the output of the command just sent, try using a capturebox and pass in the coordinates based off of your current mouse cursor location (look up MouseX, MouseY if I remember).
Or use a Text Check that includes the whole area, but only looks for the appropriate text (call support for help on that one, I won't even begin to be able to explain how to do it here).
I asked a similar question a while ago... The only way that I found around this was to use a blind text writing function to the window that was opened by the telnet session... I was using an Exceed environment to a Unix box, but there seems to be no other way in this instance.
Exceed exports the whole of the window (every few milliseconds) to the PC as a complete window object, therefore you can't read any of the text.
Apparently there is a (supposedly) free tool available called Easyview (sp?) that sits on the PC inside of the Exceed script and allows X-Window objects to be exported as individual objects... including text.... but I haven't found a copy yet...
If anyone out there knows... please send in a link to here.