Answered

Ability upload a file and then download in the same test execution

We need to be able to download a file from our application and then upload that same file within the same test execution, without having to store the file in the local or proof repository. Also would be great if we could rename the file as a command as well. 

0
4 comments
Avatar
Joseph Hamdan

Hi Marcus,

We appreciate users requesting enhancements. We are evaluating your request and will provide updates, hopefully soon.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Jonathan Hotz

Hi Marcus,

I can suggest next solution.

Use this snippet in Execute_Java command right after you downloaded this file.

Class Name is com.subject7.DownloadHelper

Method name is getMostRecentFile

It will store the most recent file path in C:\Users\<username>\Downloads to a variable, that you can use after in File_Upload command.

If on your machine files are downloaded to other place, you can override path for search by setting variable DOWNLOAD_FOLDER via Set_Var.

0
Comment actions Permalink
Avatar
Bodepudi, Preethi (NIH/OD) [C]

Hello Alexei,

Thank you for the response, I am not able to download the file which you  send to me in the link, I see the system s checking for admin login while downloading the file  ,i am able to download only jar file

Can you please send me this in zip file, and I never used code snippets in proof and I may need a help from you to setup this in proof.

Can I know your availability so that I will schedule  meeting with you

 

Regards,

Preethi

Preethi

0
Comment actions Permalink
Avatar
Jonathan Hotz

Hi Marcus,

sorry for delay with answer.

Here is link to zip file.

 

Here is instruction:

  1. Unzip file to have jar file from archive.
  2. Go to Artifacts -> File Uploads and upload this jar.
  3. Go to Artifacts -> Code snippets and create new snippet.
  4. Select JAR from point #2 in Dependencies dropdown of snippet form and provide Class com.subject7.DownloadHelper
  5. Go to your test case.
  6. Add Wait command after the step that starts file download. Add enough timeout to be sure file is downloaded.
  7. Then add command Execute_Java, select Snippet you have created in point #4 and fill Method field with getMostRecentFile
  8. As soon as command from point #7 is executed path for downloaded file will be stored to variable @DOWNLOAD_HELPER_MOST_RECENT_FILE, so you can reuse it in other commands.

For file upload you need to use command File_Upload. Unfortunately, right now it allows to upload files that were uploaded to platform before. We will add possibility to use random paths in one of next releases to allow you to use @DOWNLOAD_HELPER_MOST_RECENT_FILE there. We will inform you as soon as update will be released.

0
Comment actions Permalink

Please sign in to leave a comment.