Expect on windows download

Expect on windows download

There are multiple efforts and products offering expect for MS Windows.

Gordon Chaffee ported Expect 5.21r1b1 . Binary and source are available at [L1 ][L2 ], and also present in MyrmecoX (?). This corresponds to Tcl version 8.0.

A port of Expect (based off 5.43) was available from ActiveState [L3 ], included in ActiveTcl 8.4.11.1 or later. Due to discontinuation of Teapot support on ActiveTcl, Expect is now de facto unavailable for ActiveTcl. Available Tcl packages on ActiveState website are yet to be updated accordingly, and may be misleading.

It could get interact if someone really needs it. All that’s needed is lots of development time and good verification test cases. — DG

cygwin’s Expect works fine under Cygwin as long as what you’re expect’ing upon is a cygwin application. It does not work with normal/native Win32 console applications. — Andreas Kupries [2001-sep-20]

During the early winter 2001-2002, Telindustrie LLC briefly supported David Gravereaux’s work to port 8.4 to Windows. Davy’s pretty much the world’s most knowledgeable person about what this will involve. He writes,

The windows specific code is already in the official repository off on a branch [L4 ]

There are lots of ways this could go. Perl (and Python?) people might help out with Expect, and Win* expertise perhaps would be part of the package. Also interesting is a comp.lang.tcl exchange [L5 ] between Jiang Wu and Jeffrey Hobbs; note mention of how more of Expect might move into the Tcl core.

[Why and how it doesn’t work for Win95. Problems with interact.] [Experience with Win2000.] [ Pure-Tcl telnet available—this sometimes suffices.]

[Expect 5.25/Tcl 7.6 for Japanese.] [5.31/8.2 as source.]

[ Tony Summerfelt’s been mostly successful with Expect under Win2000.]

Is there a need for a trap to receive the «signal» when Expect is used as a Windows service? [L6 ]

IMO, No. The windows model provides this and the «shell» being used for the service control should get «going down» notices and hopefully «do the right thing». If expect.exe knows nothing for being a windows service, for which it shouldn’t being a CLI shell, one should build a shell with all the needed service parts to get the notifications they need. See tclsvc — Tcl as an NT Service — DG

LV Sometimes people talk about wanting Expect running under Windows, but it turns out that they really are wanting to drive GUI applications, which is a use for which Expect is not intended.

escargo 19 Apr 2005 — Using driving as a search produced (among others): Techniques for ‘driving’ Windows applications.

AM Expect for Windows as available in ActiveTcl 8.4.xx works very very nicely, but there is a caveat:

I have no idea why, but I really had trouble getting a simple expect script to run (exp_send did not work if you gave it an explicitly spawn ID, the whole program hung when the input from the spawned process was not a complete line — the very reason I needed Expect in the first place).

These problems are probably due to the way DOS-boxes work. It all works fine when you use wish.

LV What is a DOS-box?

DG: I think what AM is saying refers to executing commands from the system prompt. IOW:

cmd.exe is not needed! Just spawn ftp.exe. I think there’s a bug with how E4W tries to get text through cmd.exe but can’t for some reason (unknown).

SG: cmd.exe is not needed if you’re spawning an .exe file — it is necessary if you’re trying to spawn a .bat file. AIUI, there’s no way to use ActiveState’s expect with a bat file. The version of expect with cygwin seems to work with cmd.exe, however.

Njay: I had worked with expect for Windows before, but I recently was unable to get it working on a quad-core with XP. spawn simply doesn’t launch the process and doesn’t issue any error. Also tried the «open |» feature but there were some unexplainable quirks so, I started to think that a simple version of expect could be implemented in Tcl. So here it is; the limitations are plenty but for basic applications it should do the trick.

Читайте также:  Windows 10 состоялся релиз

Njay: I did a minor update on the expect proc above and added the pause proc. This code is a lib.

AMG: What does [send_user] do? Can’t it just be «puts $args»?

send_user takes care that the arguments are evaluated in the caller’s context. It is written as if the default context could have variables that would hide the caller’s variables. Of course the client could have had that outcome by just using puts. send_user is «expected» to be in expect though.

RJ: There’s currently no version of Expect that works correctly with 64bit Windows 7 and above. Does anyone have time to get this working?

As I have investigated, «Expect» does NOT appear to be included in ActiveTCL v8.5 for windows (Installer name: ActiveTCL8.5.13.0.296436-win32-ix86-threded.exe). Could anyone please confirm that and/or update the relevant text.

Hi, the link to Gordon Chaffee’s Expect port in invalid(maybe outdated). Do you know what could be the right link now?

Working with Expect script on windows environment

Thursday, February 18, 2010

Expect and windows xp

[if you know about Expect, you can jump your interested area]

Introduction
In wikipedia, about expect «Expect is a Unix automation and testing tool, written by Don Libes as an extension to the Tcl scripting language, for interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, ssh, and others. It uses Unix pseudo terminals to wrap up subprocesses transparently, allowing the automation of arbitrary applications that are accessed over a terminal. With Tk, interactive applications can be wrapped in X11 GUIs.»

In simple words, Expect is very powerful scripting language to test complex protocol. Mostly used for conformance testing in networked environment. Expect can send the data across network and validate results with predefined values. For more details use official expect website @ expect.nist.gov. Working with expect is fun in windows environment.

Need of Expect in Windows
Now, let’s talk about the need of Expect in windows. Most of us have windows environment at work location (due to any reason). And, it is not worth to set up linux environment for Expect only. Moreover, with small steps, it is possible to set up expect on windows environment too.

Steps to start expect on Windows
So, follow following simple steps and your expect script will work as charm 🙂

  1. Download Active Tcl from http://www.activestate.com/activetcl/downloads/
  2. Install (Typically @ c:/Tcl/ directory)
  3. Go to Bin directory in Command prompt (Start > Run > commad > cd c:\Tcl\bin)
  4. (only required if you use proxy) teacup proxy

(e.g. teacup proxy myproxy.com 8080)

  • Instruct teacup to install Expect by teacup install Expect
  • DONE!
  • Convert Expect file in windows format
    Now we have expect installed and we need to convert expect file into windows format. which is infect more simple. It is optional but good idea to convert extension to .tcl.

    We need to add following lines @ beginning of expect file.
    Running expect file in windows
    Go to command prompt and navigate to folder where you kept your expect script.
    Run using tclsh85.exe file as follows.

    Can I use Expect on Windows without installing Cygwin?

    Expect is a module used for spawning child applications and controlling them. I’m interested in Python and Ruby.

    6 Answers 6

    Notes in the wexpect.py file (typos unchanged and highlighting added)

    Wexpect is a port of pexpext to Windows. Since python for Windows lacks the requisite modules (pty, tty, select, termios, fctnl, and resource) to run pexpect, it was necessary to create a back-end that implemented any functions that were used that relied on these modules. Wtty.py is this back-end. In the Windows world consoles are not homogeneous. They can use low level or high level input and output functions, and to correctly deal with both cases two child processes are created for instacne of Spawn, with an intermidate child that can continuously read from the console, and send that data over a pipe to an instance of wtty. Spawner.py is resposible from reading and piping data.

    I’ve left as much code intact as I could and also tried to leave as many comments intact is possible (espicially for functions that have not been changed) so many of the comments will be misleading in their relationship to os specific functionality. Also, the functions sendcontrol and sendeof are unimplemnted at this time, as I could not find meaningful Windows versions of these functions.
    additionally, consoles do not have associated fild descriptors on Windows, so the global variable child_fd will always be None.

    Читайте также:  Dosbox для windows 10 изменить разрешение

    pexpect 4.8.0

    pip install pexpect Copy PIP instructions

    Released: Jan 21, 2020

    Pexpect allows easy control of interactive console applications.

    Statistics

    View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery

    License: ISC License (ISCL) (ISC license)

    Maintainers

    Classifiers

    • Development Status
      • 5 — Production/Stable
    • Environment
      • Console
    • Intended Audience
      • Developers
      • System Administrators
    • License
      • OSI Approved :: ISC License (ISCL)
    • Operating System
      • MacOS :: MacOS X
      • POSIX
    • Programming Language
      • Python
      • Python :: 2.7
      • Python :: 3
    • Topic
      • Software Development
      • Software Development :: Libraries :: Python Modules
      • Software Development :: Quality Assurance
      • Software Development :: Testing
      • System
      • System :: Archiving :: Packaging
      • System :: Installation/Setup
      • System :: Shells
      • System :: Software Distribution
      • Terminals

    Project description

    Pexpect is a pure Python module for spawning child applications; controlling them; and responding to expected patterns in their output. Pexpect works like Don Libes’ Expect. Pexpect allows your script to spawn a child application and control it as if a human were typing commands.

    Pexpect can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup scripts for duplicating software package installations on different servers. It can be used for automated software testing. Pexpect is in the spirit of Don Libes’ Expect, but Pexpect is pure Python.

    The main features of Pexpect require the pty module in the Python standard library, which is only available on Unix-like systems. Some features—waiting for patterns from file descriptors or subprocesses—are also available on Windows.

    Project details

    Statistics

    View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery

    License: ISC License (ISCL) (ISC license)

    Expect on windows download

    This package has been donated to Jest. This means that all future development of expect v21+ will take place at facebook/jest.

    You can use jest-codemods to automatically migrate your old tests using expect@1.x to the new jest version of expect (>= 21)

    Versions prior to v21 will receive limited support and bugfixes, and any future

    expect lets you write better assertions.

    When you use expect , you write assertions similarly to how you would say them, e.g. «I expect this value to be equal to 3» or «I expect this array to contain 3». When you write assertions in this way, you don’t need to remember the order of actual and expected arguments to functions like assert.equal , which helps you write better tests.

    You can think of expect as a more compact alternative to Chai or Sinon.JS, just without the pretty website. 😉

    Then, use as you would anything else:

    The UMD build is also available on unpkg:

    You can find the library on window.expect .

    Asserts the given object is truthy.

    Asserts the given object is falsy.

    Asserts that object is strictly equal to value using === .

    Asserts that object is not strictly equal to value using === .

    Asserts that the given object equals value using is-equal.

    Asserts that the given object is not equal to value using is-equal.

    Asserts that the given block throw s an error. The error argument may be a constructor (to test using instanceof ), or a string/ RegExp to test against error.message .

    Asserts that the given block does not throw .

    expect(object).toBeA(constructor, [message])
    expect(object).toBeAn(constructor, [message])

    Asserts the given object is an instanceof constructor .

    expect(object).toBeA(string, [message])
    expect(object).toBeAn(string, [message])

    Asserts the typeof the given object is string .

    expect(object).toNotBeA(constructor, [message])
    expect(object).toNotBeAn(constructor, [message])

    Asserts the given object is not an instanceof constructor .

    expect(object).toNotBeA(string, [message])
    expect(object).toNotBeAn(string, [message])

    Asserts the typeof the given object is not string .

    expect(string).toMatch(pattern, [message])
    expect(object).toMatch(pattern, [message])

    Asserts the given string or object matches a pattern . When using a string, pattern must be a RegExp . When using an object, pattern may be anything acceptable to tmatch .

    expect(string).toNotMatch(pattern, [message])
    expect(object).toNotMatch(pattern, [message])

    Asserts the given string or object does not match a pattern . When using a string, pattern must be a RegExp . When using an object, pattern may be anything acceptable to tmatch .

    expect(number).toBeLessThan(value, [message])
    expect(number).toBeFewerThan(value, [message])

    Asserts the given number is less than value .

    Читайте также:  Speedlink snappy microphone webcam 350k pixel драйвер windows 10

    Asserts the given number is less than or equal to value .

    expect(number).toBeGreaterThan(value, [message])
    expect(number).toBeMoreThan(value, [message])

    Asserts the given number is greater than value .

    Asserts the given number is greater than or equal to value .

    expect(array).toInclude(value, [comparator], [message])
    expect(object).toInclude(value, [comparator], [message])
    expect(string).toInclude(value, [message])

    Asserts that a given value is included (or «contained») within another. The actual value may be an array, object, or a string. The comparator function, if given, should compare two objects and return false if they are not equal. The default is to use isEqual .

    expect(array).toExclude(value, [comparator], [message])
    expect(object).toExclude(value, [comparator], [message])
    expect(string).toExclude(value, [message])

    Asserts that a given value is not included (or «contained») within another. The actual value may be an array, object, or a string. The comparator function, if given, should compare two objects and return false if they are not equal. The default is to use isEqual .

    expect(object).toIncludeKeys(keys, [comparator], [message])
    expect(object).toIncludeKey(key, [comparator], [message])

    Asserts that the given object (may be an array, or a function, or anything with keys) contains all of the provided keys. The optional parameter comparator is a function which if given an object and a string key, it should return a boolean detailing whether or not the key exists in the object. By default, a shallow check with Object.prototype.hasOwnProperty is performed.

    expect(object).toExcludeKeys(keys, [comparator], [message])
    expect(object).toExcludeKey(key, [comparator], [message])

    Asserts that the given object (may be an array, or a function, or anything with keys) does not contain any of the provided keys. The optional parameter comparator is a function which if given an object and a string key, it should return a boolean detailing whether or not the key exists in the object. By default, a shallow check with Object.prototype.hasOwnProperty is performed.

    Asserts the given spy function has been called at least once.

    Asserts the given spy function has not been called.

    Asserts the given spy function has been called with the expected arguments.

    Every assertion returns an Expectation object, so you can chain assertions together.

    expect also includes the ability to create spy functions that can track the calls that are made to other functions and make various assertions based on the arguments and context that were used.

    Creates a spy function with an (optional) implementation and (optional) restore logic. (In order for your provided implementation to be used, you must call andCallThrough .) For this reason, it’s better to use andCall if you don’t need custom restore logic.

    Replaces the method in target with a spy.

    Restores all spies created with expect.spyOn() . This is the same as calling spy.restore() on all spies created.

    Spy methods and properties

    Makes the spy invoke a function fn when called.

    Makes the spy call the original function it’s spying on.

    Makes the spy return a value.

    Makes the spy throw an error when called.

    Restores a spy originally created with expect.spyOn() .

    Clears out all saved calls to the spy.

    An array of objects representing all saved calls to the spy.

    You can use the length of the calls array to make assertions about how many times you expect the spy to have been called.

    You can also use the array to make assertions about each individual call. Each call object contains the following properties:

    The this value of the call’s execution context.

    An array of the arguments passed to the spy for the particular call.

    Оцените статью