0

I am trying to upload a XML file using loadrunner vugen. I have placed the file in loadrunner script file and make sure that all the headers and correlation values are perfect. Still the file is not getting uploaded. When I tried to add the missing content-type=application/xml after the file then I am facing memory violation error.

web_submit_data("Fileupload_VF_3",
    "Action={P_BFCTool_URL}/Fileupload_VF",
    "Method=POST",
    "EncType=multipart/form-data",
    "TargetFrame=",
    "RecContentType=text/html",
    "Referer={P_BFCTool_URL}/apex/Fileupload_VF?sfdc.tabName={C_lID}",
    "Snapshot=t28.inf",
    "Mode=HTTP",
    ITEMDATA,
    "Name={C_JID}", "Value={C_JID}", ENDITEM,
    "Name=j_id0:j_id5:pgblck:j_id33:j_id35:ftype", "Value=NFeDF", ENDITEM,
    "Name=j_id0:j_id5:pgblck:j_id43:j_id44:0:j_id45:fileId:inputFile:file", "Value={P_NFEDF_File}.xml", "File=yes", ENDITEM,
    "Name=j_id0:j_id5:pgblck:j_id43:j_id44:1:j_id45:fileId:inputFile:file", "Value=", "File=yes", ENDITEM,
    "Name=j_id0:j_id5:pgblck:j_id43:j_id44:2:j_id45:fileId:inputFile:file", "Value=", "File=yes", ENDITEM,
    "Name=j_id0:j_id5:pgblck:j_id43:j_id44:3:j_id45:fileId:inputFile:file", "Value=", "File=yes", ENDITEM,
    "Name=j_id0:j_id5:pgblck:j_id43:j_id44:4:j_id45:fileId:inputFile:file", "Value=", "File=yes", ENDITEM,
    "Name={C_UploadJID}", "Value=Upload", ENDITEM,
    "Name=com.abcd.ViewState", "Value={C_Viewstate2}", ENDITEM,
    "Name=com.abcd.ViewStateVersion", "Value={C_ViewstateVersion2}", ENDITEM,
    "Name=com.abcd.ViewStateMAC", "Value={C_ViewStateMAC2}", ENDITEM,
    "Name=com.abcd.ViewStateCSRF", "Value={C_ViewstateCSRF2}", ENDITEM,
    LAST);

In the same script I have a PDF upload and the same is working fine. Is XML upload is possible with loadrunner and how to resolve the issue?

Raj
  • 57
  • 7
  • could you please post the full step that you are using. – Buzzy Mar 04 '18 at 08:04
  • @Buzzy I have updated the question with the required information. Please suggest any work around. – Raj Mar 04 '18 at 13:20
  • In your example you are missing FilePath= argument – Buzzy Mar 04 '18 at 13:54
  • j_id33:j_id35:ftype", "Value=NFeDF", ENDITEM, "Name=j_id0:j_id5:pgblck:j_id43:j_id44:0:j_id45:fileId:inputFile:file", "Value={P_NFEDF_File}.xml", "File=yes", ENDITEM – Raj Mar 04 '18 at 15:52
  • The file path is passed as part of P_NGEDF_File – Raj Mar 04 '18 at 15:53
  • I tried adding files to script method as well as giving full file path...both doesn't work. – Raj Mar 04 '18 at 16:32
  • I think you need to have a single item such as: ```` "Name=j_id0:j_id5:pgblck:j_id43:j_id44:0:j_id45:fileId:inputFile:file", "FilePath={P_NFEDF_File}.xml", "File=yes","ContentType=application/xml", ENDITEM, ```` – Buzzy Mar 05 '18 at 06:47
  • I tried the approach...it also gives me access violation...memory violation measage – Raj Mar 05 '18 at 14:38
  • Then I am afraid you will have to open a support ticket because your approach is correct. – Buzzy Mar 05 '18 at 15:12
  • Thanks buzzy...I will look into the Same – Raj Mar 06 '18 at 04:57

1 Answers1

0

Following approach worked fine:j_id33:j_id35:ftype", "Value=NFeDF", ENDITEM, "Name=j_id0:j_id5:pgblck:j_id43:j_id44:0:j_id45:fileId:inputFile:file", "Value=filename.xml", "FilePath=.//filename.xml","File=Yes", ENDITEM

Raj
  • 57
  • 7