Live data from Hacker News

Expect – A tool for automating interactive applications

expect.sourceforge.net

41–50 of 52 posts

Re: Expect – A tool for automating interactive applications

#41
I first discovered this about two months ago. It may be old, but it solved a problem we had and nothing else quite fit the job. We're using it to run a flaky test suite and count how many times it succeeds, fails, or times out (yes, times out - yay Android!). Very important when you're trying to determine if potential stability improvements actually make a difference or not, and you need to run the 3 minute suite ten times at least to get something statistically significant.

Re: Expect – A tool for automating interactive applications

#42

Wow, a blast from the past. I still have some expect tools I wrote long ago that I use and maintain to this day. Not so much new stuff since scripting languages have gotten better at doing what expect does -- often calling their modules "expect" and using the exact same syntax. I once wrote a webserver in Expect. No, it's not a good language for writing a webserver.

Tcl shows up in all sorts of places, like Cisco IOS, or haptic feedback robotic surgery interfaces, or IRC bots. It's fast, it's small, it's robust, it's powerful. It's just not sexy.

Re: Expect – A tool for automating interactive applications

#43
post #7

Be sure to check out "autoexpect": it starts an interactive session, and generates an expect script based on that. Then you typically need to edit it for generalization (e.g., skip dates and time strings; often skip version strings, etc.).

How did I not know about this? Autoexpect is one of the thousand ways of interacting with computers that we USED to do back in the 80s and 90s that have since fallen out of favor. Macros, modem dialers, folder watchers, etc.. Remember trying the record button in Applecript Editor, only to find that it didn't actually work like it did in Macro Maker? The fact that autoexpect isn't installed by default on Mac OS blows my mind.

Edit: still trying to install autoexpect on Mac OS 10.9.2 and having no luck. Tried ActiveTcl at http://www.activestate.com/activetcl/downloads but it doesn't seem to have autoexpect. Tried brew install autoexpect, tried port install autoexpect, nothing. Sometimes unix reminds me of looking up hints in video game magazines upon finding oneself stuck, so if someone knows how to get autoexpect on Mac, please let us know because I'm throwing in the towel.

Re: Expect – A tool for automating interactive applications

#45
post #26

Earlier quoted context omitted.

Yes, it's a mixture of the two, which makes eminent sense if you consider the speed of computers 20 years ago. It's Tcl, by the way, not TCL.

Having spent time working on a million line Tcl codebase (for my sins) I can assure you that it is possible, but not in the least bit pleasant!

That I can see. But I can also see a lot of today's hip things, like Node.js, not being terribly fun either at that kind of size.

Re: Expect – A tool for automating interactive applications

#47
post #26
post #25

Earlier quoted context omitted.

My understanding was that AOLserver was the NCSA (pre-Apache httpd) server, with TCL as an extension language, not that AOLserver was written in TCL. Weird.

Yes, it's a mixture of the two, which makes eminent sense if you consider the speed of computers 20 years ago. It's Tcl, by the way, not TCL.

Hey, if it was "Tool Command Language" when I first learned it, it's "TCL" now. :-)

Then there was that weird period when all the other language's gui toolkits were based on Tk.

Re: Expect – A tool for automating interactive applications

#48

Has anyone used Expect for Windows? Any good experiences to share? I'm wondering if it's something I should take the time to learn and use.

Expect for Windows has been finicky for me every time I've tried using it, but Cygwin Expect works well, both for interacting with other Cygwin processes (not arbitrary Win32 console apps!), and for interacting with remote machines via (Cygwin) Telnet and SSH.

Re: Expect – A tool for automating interactive applications

#49
post #20

Earlier quoted context omitted.

It was great to see ShutIt during the last Docker London!

Thanks! A previous similar talk is the first link here: https://www.youtube.com/user/ianmiell

Thanks. Good luck Shutit and 2048 scores! :)

Re: Expect – A tool for automating interactive applications

#50
post #7

Be sure to check out "autoexpect": it starts an interactive session, and generates an expect script based on that. Then you typically need to edit it for generalization (e.g., skip dates and time strings; often skip version strings, etc.).

How did I not know about this? Autoexpect is one of the thousand ways of interacting with computers that we USED to do back in the 80s and 90s that have since fallen out of favor. Macros, modem dialers, folder watchers, etc.. Remember trying the record button in Applecript Editor, only to find that it didn't actually work like it did in Macro Maker? The fact that autoexpect isn't installed by default on Mac OS blows…

[deleted]
Post reply on HN