Telnet Library: 'No match found' but log shows a clear match

621 views
Skip to first unread message

marki

unread,
Apr 10, 2010, 4:26:54 PM4/10/10
to robotframework-users
Hello,

I'm trying to use the Telnet Library and I'm having difficulties
getting it to log in. Part of my problem may be due to how out systems
do logins. After entering user and password, the system immediately
prompts for a Terminal type. Normally we just hit enter to accept the
default and move on. So I'm trying to get the RF Telnet Library to do
the same.

So in the Library Import, I set the prompt to 'Terminal type?
[scoansi]'

If I look in the trace I see:
No match found for 'Terminal type? [scoansi]' in 3 seconds

But just 5 line above that in the same trace I see:
Terminal type? [scoansi]

Even if I get past this, I now have a problem in that my prompt will
now be something completely different like:
[root@QATNIP /root]#

So when would I need to do a 'Set prompt' ?

Is there any way I can ignore prompts and just fire in commands and
ignore the output? I just need to log in, cd to a directory, start a
program and then exit.

==============================================================================
+ START SUITE: Terminal Testplan [ ]
==============================================================================
+- START TEST: Start RC Host For All Tests To Use [ ]
------------------------------------------------------------------------------
+-- START KW: Start RC Host [ ${HOST_ADDRESS} | ${HOST_LISTEN_PORT} |
{HOST_BACKDOOR_PORT} | {HOST_LOG_PORT} | {HOST_CONTROL_PORT} ]
+--- START KW: Telnet.Open Connection [ ${host} ]
Opening connection to qatnip:23 with prompt: (u'Terminal type?
[scoansi]', False)
+--- END KW: Telnet.Open Connection (110)
+--- START KW: Telnet.Login [ root | ${LINUX_ROOTPASS} ]
Restricted Access!
login: root
root
Password: ******

Last login: Sat Apr 10 21:11:29 from 172.17.241.121
+------------------------------------------------------------------------------
+
( detail cut)
+------------------------------------------------------------------------------
+
You have new mail.
Terminal type? [scoansi]
+--- END KW: Telnet.Login (1092)
+--- START KW: Telnet.Execute Command [ \n ]
>
>
No match found for 'Terminal type? [scoansi]' in 3 seconds

Janne Härkönen

unread,
Apr 12, 2010, 2:09:43 AM4/12/10
to ma...@irvinesonline.org, robotframework-users
On Sat, Apr 10, 2010 at 11:26 PM, marki <ma...@irvinesonline.org> wrote:
> Is there any way I can ignore prompts and just fire in commands and
> ignore the output? I just need to log in, cd to a directory, start a
> program and then exit.

Hello,

This should be possible by just not setting the prompt at all.

If the prompt is set in library import, login keyword will try to
consume the output up until the prompt. If the prompt is not set, this
will not happen.

After the login, you should be able to just use the write keyword,
which also does no output checking.


hth,
__janne

Reply all
Reply to author
Forward
0 new messages