Expect great script automation from expect-lite

expect-lite is an quick and easy command-line automation tool that’s designed to directly map an interactive terminal session into an automation script. You can create basic expect-lite scripts by simply cutting and pasting text from a terminal window into a script, and adding “>” and “<" or other special character to indicate the action. Because the software ignores any line that does not begin with a special character, any screen log can be turned into a script in the matter of seconds. Expect-lite is targeted at the verification testing environment; it produces a pass/fail result at the end of the script. However, its use is not limited to this environment. The tool is written in the Expect scripting language, but it requires no knowledge of Expect. In fact, it’s so simple it takes no more than five minutes to learn.

Developer Craig Miller created expect-lite after leaving a job where he worked with a proprietary automation language. “I wanted to use a more standardized language like Expect, but it uses just too many curly braces, and it is easy to create cryptic code, which is hard to debug. I wanted to create a simple language that focused on getting the job done, rather than making users spend hours learning and debugging. Expect seemed like a good place to start.

“After three years of using expect-lite heavily at my job, I was able to convince management to open-source the software. I chose SourceForge for hosting, because at that time (and still today) it was the premier open source hosting site.”

Although expect-lite follows the keep-it-simple principle, Miller has added features over the years, many of them suggested by users, giving it the power to solve just about any automation problem. One trick he suggests is to use -vv to enable debug logging.

While the software contains an Integrated Debugger Environment, Miller says it doesn’t see much use by the community, and could stand improvement. If you’d like to help with the project, or have a suggestion for improving the software, the best way to get in touch is via email.


Comments are closed.