microsoft / azure-load-testing

MIT License
22 stars 2 forks source link

Run a test with files #55

Closed adiazcan closed 2 years ago

adiazcan commented 2 years ago

I have a JMeter test plan that uploads a file to an endpoint using HTTP Post. I removed all the path reference from the file, as follow:

        <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs">
          <collectionProp name="HTTPFileArgs.files">
            <elementProp name="powerpoint.pptx" elementType="HTTPFileArg">
              <stringProp name="File.path">powerpoint.pptx</stringProp>
              <stringProp name="File.paramname">File</stringProp>
              <stringProp name="File.mimetype">application/octet-stream</stringProp>
            </elementProp>
          </collectionProp>
        </elementProp>

When I ran the test, the processor didn't find the file and I had the following error:

Non HTTP response code: java.io.FileNotFoundException/Non HTTP response message: powerpoint.pptx (No such file or directory)

When I downloaded the input files, the following files are on the artifacts zip:

image

How can I reference the file on the test plan in order to use it on the tests?

AB#1487169

adiazcan commented 2 years ago

Hi @abranj1219, @ninallam

Any help with attaching files for testing?

Sachid26 commented 2 years ago

Hi @adiazcan ... Thank you for reporting the issue. Could you please help us with the test plan if possible and the type of file you are trying to upload?

adiazcan commented 2 years ago

Hi @Sachid26

this is the JMeter test (I removed sensible information from it)

GadaCompleto-github.jmx.zip

This is the file that I want to upload using the test plan powerpoint.pptx

adiazcan commented 2 years ago

Hello @Sachid26

Did you have time to review the files?

Sachid26 commented 2 years ago

Apologies for the delay. The zip seems to be empty when i try to extract the file.

rithvikp1998 commented 2 years ago

Hi @adiazcan, I am unable to extract the files from the zip you gave, Windows just complains the file is invalid. I created a simple test plan which uploads a random file and it seems to be working well, both in our service and in my local machine.

Are you able to run your test in your local machine? Can you please share the url to the test that failed in our service?

These are the files I used to test:
FileUpload.zip

rithvikp1998 commented 2 years ago

Hi @adiazcan Is the issue resolved? Or do you need any help with it?

abranj1219 commented 2 years ago

@adiazcan , Could you please confirm and get back. Closing this issue for now. Please feel free to repon in case you need any support

adiazcan commented 2 years ago

Hi Team, sorry for not answering before, we had a lot of work testing our application using jmeter.

We tested again and it didn't work but we don't know why.

Our test work on local, running from jmeter gui, but when we upload the test plan and the attached file, the test failed on running on Azure with the not found file error.

adiazcan commented 2 years ago

Trying to find the differences between your plan test and our plan test, our use case not only has a File to upload, also has a parameter and, for this, we need to use "multipart/form-data" and Java for the client implementation.

Those are the differences

make sense?

adiazcan commented 2 years ago

Hi @abranj1219 @rithvikp1998

did you have time to see my latests messages?

rithvikp1998 commented 2 years ago

Hi @adiazcan I tried to reproduce the issue again and it looks like there is some race condition in JMeter/our service which is underreporting the number of samples. When I have 1 loop in my test plan, it is sometimes showing 0 samples (which we consider as a failed test) and sometimes showing 1 sample (which is considered a success). This is probably why I wasn't able to reproduce earlier. I am looking into what is causing this issue and I will get back to you when I find something