SFTP

299 views
Skip to first unread message

RF bhushan

unread,
Jul 5, 2017, 8:17:20 AM7/5/17
to robotframework-users

Hello all

I need to transfer a file called myfile.txt in to my remote host hardware. But somehow the test case which i wrote below is not successful Can anyone help me in getting the task done. THank you












*** Settings ***

Documentation          Transfer a file from my local host PC to the remote host OCU
Library                SSHLibrary

*** Variables ***

${LOCALSERVER}              192.168.2.130
${SYSTEM_USER}              hi
${SYSTEM_PASSWORD}    ihi
${source}                   /home/myfile.txt
${REMOTESERVER}             192.168.2.360
${REMOTE_USER}              root
${REMOTE_PASSWORD}          root
${destination}              /home/var

*** Test Cases ***

Transfer a file into the defined directory
   
    Put file      ${source}      ${destination}

*** Keywords ***

Put file
     [Arguments]    ${source}   ${destination}  
     Open Connection  ${LOCALSERVER}
     Login  ${SYSTEM_USER}    ${SYSTEM_PASSWORD}
     Log To Console     Logged in to server
     Put file    ${source}   ${destination}
     close all connections

Hélio Guilherme

unread,
Jul 5, 2017, 8:31:35 AM7/5/17
to robotframework-users
You say "is not successful". Do you get any error?
If necessary, run with loglevel DEBUG.

Please take care, that the protocol is SSH not SFTP.


My Favorite Open Source Projects
awsome-lists gretl robotframework
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.pt/

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

RF bhushan

unread,
Jul 5, 2017, 8:38:29 AM7/5/17
to robotframework-users
When i run the test case on my linux oc i see it as a failure. Can you please help me what should i change in the written test suite. PLease help me
To post to this group, send email to robotframe...@googlegroups.com.

Hélio Guilherme

unread,
Jul 5, 2017, 8:49:50 AM7/5/17
to robotframework-users
Well, you still don't tell us what is the error.

Maybe is related with you trying to redefine the Put File keyword.

Try to change the name of your keyword and call in the test. Or use "SSHLibrary.Put File" inside your keyword.

My Favorite Open Source Projects
awsome-lists gretl robotframework
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.pt/

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.

RF bhushan

unread,
Jul 5, 2017, 8:58:12 AM7/5/17
to robotframework-users
Please see the centre image. THats the error
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
Screenshot from 2017-07-05 14-56-09.png

Hélio Guilherme

unread,
Jul 5, 2017, 9:14:42 AM7/5/17
to robotframework-users
Does this say anything to you?
"There are no source files matching 'myfile.txt'."

Always open the log.html to see what are the keywords failing!

Please copy only the relevant text, no screenshots.


My Favorite Open Source Projects
awsome-lists gretl robotframework
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.pt/

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.

RF bhushan

unread,
Jul 5, 2017, 9:19:56 AM7/5/17
to robotframework-users

Ok. Thanks for the suggestion. I just opened the log and it is hsowing me the putfile keyword is unsuccesful








TEST Transfer a file into the defined directory
Full Name:Sftp1.Transfer a file into the defined directory
Start / End / Elapsed:20170705 15:16:32.863 / 20170705 15:16:34.170 / 00:00:01.307
Status:FAIL (critical)
Message:There are no source files matching '/home/myfile.txt'.
00:00:01.306KEYWORD Put File /home/myfile.txt, /var/lib
Start / End / Elapsed:20170705 15:16:32.863 / 20170705 15:16:34.169 / 00:00:01.306
00:00:00.000KEYWORD SSHLibrary . Open Connection ${LOCALSERVER}
00:00:01.289KEYWORD SSHLibrary . Login ${SYSTEM_USER}, ${SYSTEM_PASSWORD}
00:00:00.014KEYWORD SSHLibrary . Put File ${source}, ${destination}
Documentation:

Uploads file(s) from the local machine to the remote machine.

Start / End / Elapsed:20170705 15:16:34.154 / 20170705 15:16:34.168 / 00:00:00.014
15:16:34.163INFO[chan 1] Opened sftp connection (server version 3)
15:16:34.167FAILThere are no source files matching '/home/myfile.txt'.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

Hélio Guilherme

unread,
Jul 5, 2017, 9:30:11 AM7/5/17
to robotframework-users
You still don't know how to fix?

You have two options:
1. create the file 'myfile.txt' at '/home/'
2. make sure the path is correct. For example, '/home/username/myfile.txt'

My Favorite Open Source Projects
awsome-lists gretl robotframework
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.pt/

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.

RF bhushan

unread,
Jul 5, 2017, 9:42:25 AM7/5/17
to robotframework-users
SO this is my new test case looks like



*** Settings ***

Documentation          Transfer a file from my local host PC to the remote host OCU
Library                SSHLibrary

*** Variables ***

${LOCALSERVER}              192.168.2.170
${SYSTEM_USER}              bhushan
${SYSTEM_PASSWORD}          bhushanbhushan
${source}                   /home/bhushan/myfile.txt
${REMOTESERVER}             192.168.2.200

${REMOTE_USER}              root
${REMOTE_PASSWORD}          root
${destination}              /var/lib


*** Test Cases ***
Transfer a file into the defined directory
    Put File     /home/bhushan/myfile.txt      /var/lib

*** Keywords ***
Put File

    [Arguments]    ${source}   ${destination}  
     Open Connection  ${LOCALSERVER}
     Login  ${SYSTEM_USER}    ${SYSTEM_PASSWORD}
     Put File    ${source}   ${destination}
     close all connections




When i run this on the terminal i cant see nothing. I mean it is not showing whether it is pass or not
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

RF bhushan

unread,
Jul 6, 2017, 9:42:41 AM7/6/17
to robotframework-users
Hi. Can you please try to help me. I defined the path correctly. Can you check the test suite if it is ok or not. Please try to help me
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

Hélio Guilherme

unread,
Jul 6, 2017, 9:52:49 AM7/6/17
to robotframework-users
It is very difficult for us to do that checking.

You must understand the error messages, and find a solution.

Ask questions, like:
Does the logged in user have access to the file?
Is the file in the host system really at that path?

Good luck.

My Favorite Open Source Projects
awsome-lists gretl robotframework
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.pt/

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages