★ wanayoo — archive 1999 http://dev.scriptics.com/services/training/expect.htmlNouvelle recherche | Portail wanayoo
Developer Site
Getting StartedTcl AdvocacySoftware ResourcesDocumentsServicesCommunity
Home
Login | Bug DB | Open Source Support | Commercial Support |  Tcl Training| | Tcl Consulting | Ajuba2
Search 
Course Descriptions | On-Site Training | Directions to Mountain View Courses

LEVEL:

Advanced topic

DURATION:

2 days

FORMAT:

Lectures and hands-on programming activities

PREREQUISITES:

Building Applications with Tcl/Tk, or The Tcl Programming Language, or similar mastery of Tcl: variables, loops, procedures, quoting, etc.

BOOKS PROVIDED:

Exploring Expect
and Scriptics course notes




Automated testing and system administration still involve a lot of manual interaction. Many applications still do not have a scripting interface that helps automate QA testing. That forces test engineers to manually conduct their tests to ensure that applications behave appropriately.

Many tasks in system administration also require manual interaction: system administrators must change passwords on hundreds of accounts on hundreds of machines; software updates frequently require that an installation path be entered--doing so on hundreds of hosts can be tedious and time-consuming.

Expect is a Tcl extension that helps to automate these kinds of interactive tasks. With Expect, you write a script that starts an application, waits for its output, and sends the appropriate commands. Once written, the script automates the same steps that you previously took in working with the application. Instead of manually testing software, or connecting to hundreds of machines you will let your Expect script do the work for you while you move on to your next project.

This course builds on your knowledge of Tcl scripting and is appropriate for anyone who has taken our Building Applications with Tcl/Tk or Tcl Programming Language course, or someone with similar mastery of Tcl. We will show you how to use the Expect extension to automate interactive tasks. Particular emphasis is placed on using Expect for software testing and system administration.

As with all of our courses, this course uses lab exercises to allow you to practice the techniques you will learn in lecture.


Schedule and Registration Form

Course sizes are limited to 20 people. If a course fills up we will put you on our waiting list and notify you of future offerings.


Course Outline

Day 1

  • Expect Basics
    • Purpose of Expect
    • Expect architecture
    • Password example
  • Core Expect Commands
    • Spawning processes
    • Interacting with user
    • Expecting output
    • Sending input
    • Ftp example
  • Simple Pattern Matching
    • Simple patterns
    • Glob-style patterns
    • Wildcard matching
    • Range matching
    • Error handling
  • Regular Expressions
    • How Different than glob-style
    • Exclusion patterns
    • Sub-patterns
    • Match variables

Day 2

  • Managing a User
    • More on Interact
    • Aliases and shortcuts
    • Interface redesign
  • Signal Handling
    • Trapping signals
    • Handling signals
    • Sending signals
  • Managing Multiple Hosts
    • Spawning multiple processes
    • Process book-keeping
    • Watching a specific host
    • Sending to a specific host
    • Multi-casting
  • Screen Scraping
    • Raw terminal mode
    • Escape sequences
    • Managing cursor locations
    • Refreshing
  • ExpecTk
    • Building a simple interface
    • Using call-backs
    • Example: Super-password

Top of page
Developer Home | Ajuba | Getting Started | Tcl Advocacy | Software Resources | Documents | Services | Community
Search | Site Map | Feedback | Contact Us | webmaster@ajubasolutions.com
Increase page width
© 1998-2000 Ajuba Solutions. All rights reserved. Legal Notice | Privacy Statement

Last modified: February 10, 2000