Expect expect = new ExpectBuilder()
.withOutput(channel.getOutputStream())
.withInputs(channel.getInputStream(), channel.getExtInputStream())
.withEchoOutput(adapt(System.out))
.withInputFilters(removeColors(), removeNonPrintable())
.withErrorOnTimeout(true)
.build();
channel.connect();
expect.expect(contains("R1>"));
expect.sendLine();
expect.sendLine("enable");
expect.expect(contains("Password: "));
expect.sendLine("abcde");
channel.disconnect();
session.disconnect();
expect.close();
Output:
1>
enable
R1>
R1>enable
Password:
% Access denied
R1>abcde
---------------------------------------------------------------------
The "enable" command and also the password seems to be sent twice.
Is this a bug or am I going wrong somewhere.
I am using the latest jar(expectit-core-0.3.1.jar).
Thank-You,
Pratik
--
You received this message because you are subscribed to the Google Groups "Yet another Expect for Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-expecti...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.