Ask a Question

How do I download a file from FTP server in ReadyAPI?

indraniria
Contributor

How do I download a file from FTP server in ReadyAPI?

As I post an API, a file gets generated in a remote server.

I can see the file connecting via FileZilla in port 22. I need to validate the content of this file. 

How do I do this?

Also, below script is giving false to me

import org.apache.commons.net.ftp.FTPClient
FTPClient client = new FTPClient();
client.connect(host);
boolean isSuccess = client.login(username, password);
log.info isSuccess

2 REPLIES 2
richie
Community Hero

Hey @indraniria 

 

 

I think someone posted an equivalent issue a while back.  I'll have a look and see if I can find the post and the solution - but it wont be today - I am flat out with work today.

 

Cheers,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
TNeuschwanger
Champion Level 2

Hello @indraniria 

 

Sorry I don't have specific example, but I have used a library to perform the tasks you describe that you could look into to see if it meets your needs...

It is Jsch by JCraft

http://www.jcraft.com/jsch/

 

Download the .jar file and place in your installation .lib folder. 

add "import com.jcraft.jsch.*;" import line to you groovy script test step to use features in examples.

 

Their website has some java examples you can drop right into groovy script test steps.

http://www.jcraft.com/jsch/examples/

 

I used to execute commands on remote computers with this library successfully and relatively painless.

 

Regards,

Todd

cancel
Showing results for 
Search instead for 
Did you mean: