Forum Discussion

baechu123's avatar
baechu123
Occasional Contributor
8 years ago

Dynamically attach file in SOAPUI Pro

Hello,
 
I'm currently in the process of migrating jmeter scr

Hello,

 

I'm currently in the process of migrating jmeter scripts to soapUI. In jmeter, you just have to put the file path of the file to dynamically upload it.

 

Is there are a way in soapUI pro that works like this?

 

Thanks!

  • nmrao's avatar
    nmrao
    8 years ago
    You can define two custom properties at test case level.

    DIRECTORY_NAME - provide the directory where the file is present; use "/" as path separator even on windows.

    FILE_NAME - provide name of the file.

    The above can be done thru script as well in case you are getting the value automatically.

    For the request step, there are two columns it requires to be filled

    1. Name - ${#TestCase#DIRECTORY_NAME}/${#TestCase#FILE_NAME}

    2. ContentID - ${#TestCase#FILENAME}

    Then, I believe, you are done.
  • nmrao's avatar
    nmrao
    Champion Level 3
    what are trying to achieve? a soap request with file attachment? Yes it is possible to do so.

    By the way, please elaborate "what you mean by dynamically attach"?
    • baechu123's avatar
      baechu123
      Occasional Contributor

      For example, I have to upload many files. Is there a way that I can only put the file path of the files and don't have to manually attach it?

      • groovyguy's avatar
        groovyguy
        Community Hero

        You may be able to utilize groovy scripting to automate that part.