Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Newbie question, Expect

Posted by eliasson (eliasson), 8 April 2008
Hello,

I'm new to this forum so if I screw up, kindly let me know ...

I'm also fairly new to Expect/TCL.  My present task involves automating our software testing.  I've had some success along these lines for our Linux efforts, & am now working with Windows.

My setup is a Win2K host running Cygwin w/Expect & TCL.  The UUT (unit under test) also runs Win2k, no Cygwin.  The UUT is running an old Win remote console server.  The host is running the corresponding remote client (rclient.exe).  I'm trying to get this interaction into an Expect script.  If I run rclient from within my Cyg shell, the Cyg shell 'disappears' and a Cmd shell from the UUT magically shows up.  When I exit from the UUT shell, the Cyg shell magically re-appears.  When I try this in my script, I get a failure.  If I try this from the expect1.1> prompt, things appear to work, but I don't see any output from the UUT.

My script snippet looks as follows:
# Open remote session.  Send command to connect to UUT.
spawn /cygdrive/d/NTResKit/RCLIENT.EXE $::uutip
set remote_id $::spawn_id

expect -i $::remote_id -re $::prompt1
exp_send_user "\nconnected to $::uutip as user 'test'\n"

And the failure output is:
$ expect winRFMTestCyg.tcl 192.168.5.121
spawn /cygdrive/d/NTResKit/RCLIENT.EXE 192.168.5.121
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {2552}

expect: does "" (spawn_id 7) match regular expression "[cC]:.*>"? no
Cannot get screen info. The handle is invalid.

expect: does "Cannot get screen info. The handle is invalid.\r\r\n" (spawn_id 7)
match regular expression "[cC]:.*>"? no
expect: read eof
expect: set expect_out(spawn_id) "7"
expect: set expect_out(buffer) "Cannot get screen info. The handle is invalid.\r
\r\n"

connected to 192.168.5.121 as user 'test'

It appears to me that my problem lies with a relationship betweein {2552} and (spawn_id 7), but I'm not sure.  I believe in the KISS principle & have steered clear of dealing with multiple spawned 'stuff' so far ...

If someone has a hint that helps, I'll be grateful, though not financially so I'm afraid.

Thanx,
Anders




This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho