| |||||||||||
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.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |