Answered

Ability to select file from storage dynamically

I have some usecases where I would want to select a file for file upload dynamically in a testcase based on a parameter or dataset that is defined for the testcase. At the moment I can only inject variable names for the filename after it has been selected but that doesn't help when I really want to choose different files with different content for different szenarios in my testcase.

0
10 comments
Avatar
Joseph Hamdan

Hi Jonathan,

1. Where is the file you are going to upload located?

2. Are you going to be selecting different files based on their names?

3. How many files are you considering? 

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Jonathan Moosheer

Hi Joseph,

  • the file would be on subject7 storage (or for the future also in our own sharepoint store since there was an option to integrate that with sibject7 as well as far as I know)
  • yes, based on the filename used when uploading the files to subject7 storage I would be using that exact filename for each iteration needed. 
  • there is one use case where I have like 50+ xml files that hold data from a web form. Each file holds different data causing the form to load different form paths. In the past I solved that with just one testcase that iterates through all the files, uploading them to the form, clicking through the form (always the same "continue" button in varying counts) and sending the form.

regards, Jonathan

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Jonathan,

Apologies for the delay in response. Can you try the following steps:

1. Copy the URLs of the files that you uploaded from Repositories > File Uploads
2. Add the URLs to the data template. If you plan on injecting multiple files from the same data template into the same test case, please let me know as this requires a different structure for your data template.
3. Add your steps in the test case and perform the injections where you need.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

+Moving out of Feature Request and into General discussion as this is not a feature request

0
Comment actions Permalink
Avatar
Jonathan Moosheer

Hi,

yes this seems to work - at least on my local run. When running in the cloud the xml file couldn't load though - is it possible that the connection is not authorised on the cloud execution client?

About the template - I made a template with the url and a name as fields. I would create a dataset for each file and paste the url for each file in the dataset. when running in cloud I would select all datasets from that template and assume the testcase would be run as many times as I have dataset entries, so for each file one run, correct?

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Jonathan,

Do you mean that cloud execution VM was able to navigate to your web app but was not able to upload the file? Or was not able to navigate either? Please provide the ID of one of the executions.

Yes correct, but one thing to bear in mind, if you plan to upload multiple files in one execution, selecting multiple datasets from the same template is not going to work.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Jonathan Moosheer

It was able to navigate to my page and all was well up to the point where the fiule should have been uploaded, tehre it stopped. that would be ID 40, see screenshot:

 

This is how I configured the execution set, I would assume that setting datasets to "all" would then iterate through all available datasets:

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Jonathan,

Would you please rename the dash to underscore in the field name? If it works, this may be related to the earlier reported issue.

Clicking All radio button here is only to display whether your test cases are using all of your datasets or not. From your screenshot, neither of the checkboxes are selected, so this means you are executing only with the default.

If you want to iterate with all of the datasets, click on the checkbox next to each of them or click Select All Datasets button on the right side.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Jonathan Moosheer

Hi Joseph,

 

you were right, I made the mistake of using the dash rather than underscore in the field name again - my bad.

After correcting that the testcase runs smoothly in cloud and also when aktivating every single dataset it does make an execution per dataset, yes.

I just wonder, when i have multiple datasets in one testcase and I choose a non-matching number of datasets for each, what happens? I actually have that basic case here where two of the 3 datasets are the URL und the UserLogin where I only selected one, so in that case the single selcted option is taken for each of the multiple selected datasets. But what if i would let's say choose 3 options from one dataset and 4 from another?

 

 

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Jonathan,

If you have 2 data templates with multiple datasets in them, your selection of the dataset will determine how many combinations will be used. 

For example: 

  • 1 URL Data Template where 1 Dataset is selected and a credentials Data Template where 2 Datasets are selected  = 2 executions on the same URL, one for each credential
  • 1 URL Data Template where 2 Datasets are selected and a credentials Data Template where 2 Datasets are selected = 4 executions, 2 for each URL and credential

You can control your combinations after making your dataset selections and saving the execution set which will allow this icon to appear:

 

This is documented on this article if you would like to read further:

https://subject7.atlassian.net/wiki/spaces/SD/pages/40468511/Create+an+Execution+Set

Regards,
Subject7 Team

1
Comment actions Permalink

Please sign in to leave a comment.