sFTP Adapter transfer file

5 views
Skip to first unread message

Daniel Silva

unread,
Jan 3, 2018, 9:22:54 AM1/3/18
to Extensive Testing Users
Hi,

I'm using the following code to transfer one file but always get an error on the put file step, the others are ok. The error on report says "response error" :



def description(self):
    # testcase description
    self.setPurpose(purpose=description('summary'))
    self.setRequirement(requirement=description('requirement'))

    # steps description
    self.step1 = self.addStep(
                                                                            expected="result expected",
                                                                            description="step description",
                                                                            summary="step sample",
                                                                            enabled=True
                                                                        )
def prepare(self):
    self.ADP_SYS = SutAdapters.SFTP.Client(parent=self, destIp=input('SFTP_HOST'),destPort=input('SFTP_PORT'),login=input('SFTP_USER'),password=input('SFTP_PWD'), debug=input('DEBUG') )
    pass
def definition(self):
    # starting initial step
    if self.step1.isEnabled():
        self.step1.start()
        SYS_RET1 = self.ADP_SYS.doConnect(timeout=input('TIMEOUT'))
        SYS_RET2 = self.ADP_SYS.listingFolder(path="/var/tmp")
        SYS_RET3 = self.ADP_SYS.putFile(toFilename=input('DEST_PATH'), fromFilename=input('FILENAME'))
        if not SYS_RET1:
            self.abort("Unable to connect to " + input('SFTP_HOST') )
        self.step1.setPassed(actual="success")
def cleanup(self, aborted):
    pass

Denis MACHARD

unread,
Jan 7, 2018, 5:55:04 AM1/7/18
to Daniel Silva, Extensive Testing Users
Hi,

Can you click in the "response error" message to have more details ?

Inline image 1

Please to check the value of the 2 following parameters:
- DEST_PATH
- FILENAME

In your example, the file (FILENAME) to upload in the remote machine (SFTP_HOST) is located in the test server, it's the case ?


Denis


--
If you like this project and you want to sponsor me then I am accepting donations :) via PayPal. The money received will be used to cover web site costs, domain name reservation and more;).
---
You received this message because you are subscribed to the Google Groups "Extensive Testing Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extensive-testing-users+unsub...@googlegroups.com.
To post to this group, send email to extensive-testing-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/extensive-testing-users/b1a7d665-d1a3-4179-8354-c05a399eeb8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Silva

unread,
Jan 8, 2018, 4:53:40 AM1/8/18
to Extensive Testing Users
Hi,

when I click on response error message only shows "Failure".


Yes the file is on the test server. the variables that I have:




the filename is on the test server and the SFTP_HOST is the destination machine

Auto Generated Inline Image 1

Denis MACHARD

unread,
Jan 8, 2018, 5:17:09 AM1/8/18
to Daniel Silva, Extensive Testing Users
Hello,

Tu as oublié de préciser le nom du fichier au niveau destination.
Ta variable DEST_PATH doit aussi contenir le nom du fichier 

self.ADP_SYS.putFile(toFilename=input('DEST_PATH'), fromFilename=input('FILENAME'))


--
If you like this project and you want to sponsor me then I am accepting donations :) via PayPal. The money received will be used to cover web site costs, domain name reservation and more;).
---
You received this message because you are subscribed to the Google Groups "Extensive Testing Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extensive-testing-users+unsub...@googlegroups.com.
To post to this group, send email to extensive-testing-users@googlegroups.com.

Daniel Silva

unread,
Jan 8, 2018, 5:26:16 AM1/8/18
to Denis MACHARD, Extensive Testing Users
Merci Denis! Ça marche! 

2018-01-08 10:17 GMT+00:00 Denis MACHARD <d.ma...@gmail.com>:
Hello,

Tu as oublié de préciser le nom du fichier au niveau destination.
Ta variable DEST_PATH doit aussi contenir le nom du fichier 

self.ADP_SYS.putFile(toFilename=input('DEST_PATH'), fromFilename=input('FILENAME'))


Denis
On Mon, Jan 8, 2018 at 10:53 AM, Daniel Silva <dani.s...@gmail.com> wrote:
Hi,

when I click on response error message only shows "Failure".


Yes the file is on the test server. the variables that I have:




the filename is on the test server and the SFTP_HOST is the destination machine


--
If you like this project and you want to sponsor me then I am accepting donations :) via PayPal. The money received will be used to cover web site costs, domain name reservation and more;).
---
You received this message because you are subscribed to the Google Groups "Extensive Testing Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extensive-testing-users+unsubscr...@googlegroups.com.

To post to this group, send email to extensive-testing-users@googlegroups.com.




--
Cumprimentos / Regards:

Daniel Duarte da Silva
Reply all
Reply to author
Forward
0 new messages