3

I am trying to make a testcase in robotframework with SSHLibrary and running into an error trying to connect with the FTP server. The error I get is keyword login.login expects 0 arguments and gets two. I do not really understand why it does expect 0 arguments.

the resource file in which the keyword file exists has the following code:

*** Settings ***
Library    SSHLibrary

*** Keywords ***
lOGIN
    Set Default Configuration    30s
    Open Connection     ${HOST}
    Login               ${USERNAME}        ${PASSWORD}

The test I like to run looks like:

 *** Settings ***
Documentation    Example of testing an accrual for TLOG
Resource    ../Resources/login.robot

*** Variables ***
${HOST}    sitenv
${USERNAME}    crmapplication
${PASSWORD}  Company11*

*** Test Cases ***
logintositenv
    login.login

Any idea what is going wrong? I am especially surprised I cannot get it to work because I used the open connection and login keywords from SSHLibrary before when I was trying out a few things and it worked fine.

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
Jealgu
  • 93
  • 7
  • i presume login is your keyword name, the body of the keyword should not start at the begining of the line(there sould be spaces at the beginning). What is suspiciouse to me is the login.login, maybee you already keyword login in your resources. Try specifing SSHLibrary.Login this way you know that the keyword is the right one. – Jiri Janous Jan 18 '21 at 07:40
  • Hi Jiri, thank you for your answer. You are right about the spaces I should add before the keywords. I did, but did not properly write this in stockoverflow, apologies. I edited this. Your advice to put 'SSHLibrary.' before keywords did the trick though. Many thanks for your advice. – Jealgu Jan 18 '21 at 17:01

1 Answers1

3

As you said login.login That tells me you have probably another library that has keyword login. In this case you have to specify that you want to use SSH library. You can do this with

SSHLibrary.Login

Here you can have a look how to import library with custom name and use keywords

Jiri Janous
  • 1,189
  • 1
  • 6
  • 14
  • @Jealgu Make sure to accept this answer if it really helped you and consider up voting as well when you will have enough reputation. That is how you could thank people's effort here. :) – Bence Kaulics Jan 19 '21 at 16:40