1

I have recorded a VuGen script where a user is uploading a document. The script records fine but during replay getting http 400 error. Upon further investigating I found that the environment I'm testing have a validFileNamePattern setting that doesn't allow the character ":".

My script is sending the path C:\Users***********************\Dummypdf.pdf So obviously after the path folder "C" there will always be the character ":".

My question is, is there anything I can do in my script that will not send the path "C:"?

  • 1
    Did you try a path relative to the script? If the file in the script just put the file name – Buzzy Jul 09 '20 at 15:58
  • Hi yes, the files are added in the script and in the web_submit_data, only the file name is given. But when I replay my script, VuGen sends the complete path to the application. – Md Golam Mortuza Jul 10 '20 at 17:01
  • 1
    Edit your script so it only sends the filename, which should be path relative to your script as you have both included the file, and it should be distributed to your virtual user directory on your load generators – James Pulley Jul 16 '20 at 15:25

1 Answers1

0

With the following ITEMDATA file.ext is expanded to the full file path when sending the request

ITEMDATA, "Name=nameofformfield", "Value=file.ext", "File=Yes", ENDITEM, HTTP-Request-Body

Content-Type: multipart/form-data;boundary="--boundary" ----boundary Content–Disposition: form–data; name="nameofformfield"; filename="D:\temp\file.ext" Content–Type: text/plain

content ----boundary--

Now, some servers do not accept paths within the filename values. So you have the option to use FilePath.

ITEMDATA, "Name=nameofformfield", "Value=file.ext", "File=Yes", "FilePath=D:\temp\realfile.ext", ENDITEM,

Mahendra Andhale
  • 489
  • 8
  • 14