Forum Discussion

meldoobs's avatar
meldoobs
Occasional Contributor
11 years ago

[Resolved] Automatic file transfer

Hello,
I'm new to groovy but have managed to write some scripts to almost automate our test suite.
The last step we still have to do manually is as follows and i have no idea how to achieve it. So any help would be extremely welcome.
Please bear in mind that i'm not hugely technical, so you might have to dumb down the steps required!

Ok...
We have a script that executes a call to the command line to run a .bat file. It ends up with a zip file being created in a folder on my c:\ drive. The name is dynamically given dependent on the response in a previous test step. So a new file is generated each time we run it.
Before we can run the next text step, we have to manually move the file from my c:\ drive to a specific folder on an SFTP server using WINSCP.

So i'm asking, is there a way to have soapui move the file automatically?

6 Replies

  • SiKing's avatar
    SiKing
    Community Expert
    I would suspect the answer is: no. You will have to call a batch script, as you are doing now, which in turn calls winscp.
    But I would definitely be interested if you come up with a more elegant, or even "SoapUI native", way of doing this.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    meldoobs

    SoapUI does not provide any functionality for file transfer. As suggested by Siking you have to write your own script for doing that.

    Regards,
    Shadid
    SmartBear Sweden.
  • meldoobs's avatar
    meldoobs
    Occasional Contributor
    Ok, thanks both. It's probably a bit beyond my capabilities so i've given up for now.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Sorry there's no quick fix, but I hope it's not a critical issue for you.

    Regards,
    Manne Fagerlind
    SmartBear Support
  • meldoobs's avatar
    meldoobs
    Occasional Contributor
    Hi Manne,
    Someone has given me a script that is supposed to move files to an SFTP server but when i try to run it, i get this error....
    Wed Oct 30 09:11:25 EST 2013:ERROR:java.lang.NoClassDefFoundError: org/apache/ivy/core/settings/IvySettings. This occurs on line 5.

    This is the start of the script....
    1 #!/usr/bin/env groovy
    2 @GrabConfig(systemClassLoader=true)
    3 import groovy.grape.Grape;
    4
    5 Grape.grab(group:"ant", module:"ant-jsch", version:"1.6.5")
    6 Grape.grab(group:"com.jcraft", module:"jsch", version:"0.1.42", classLoader:this.class.classLoader.rootLoader)7
    7 def ant = new AntBuilder();
    8 def InputLocUserName = context.expand( '${#Project#IN_SMGSDKSFTPInputLocUserName}' )
    9 def InputLocPath = context.expand( '${#Project#IN_SMGSDKSFTPInputLocPath}' )
    10 def InputLocPassword = context.expand( '${#Project#IN_SMGSDKSFTPInputLocPassword}' )
    11 def sb= new StringBuffer(InputLocPath)

    I was also told to place these .jar files in the "C:\Program Files\SmartBear\SoapUI-Pro-4.6.1\bin\ext"...
    ant-1.7.0.jar
    ant-jsch-1.6.5.jar
    ant-launcher-1.7.0.jar
    ivy-2.0.0-rc2.jar
    jsch-0.1.42.jar

    The ivy jar file seems to have the IvySettings.class file under org\apache\ivy\core\settings.

    Do you know what i'm doing wrong?
  • meldoobs's avatar
    meldoobs
    Occasional Contributor
    d'oh. Just after i posted that, i tried putting the jar files in the C:\Program Files\SmartBear\SoapUI-Pro-4.6.1\lib folder instead and i didn't get the error!