Getting inverted commas appended in request while reading from csv in Jmeter?












0















I was trying to read csv file using csvdata config element in jmeter so as to test multiple logins but when I try to read the value from csv file then I get inverted commas appended with respect to result. Please tell me how to get rid of these commas being passed in the request parameters



Please find my csv data config and excel file and request parameter screenshot in attachments



Excel file image



CSV data config image



Error image










share|improve this question



























    0















    I was trying to read csv file using csvdata config element in jmeter so as to test multiple logins but when I try to read the value from csv file then I get inverted commas appended with respect to result. Please tell me how to get rid of these commas being passed in the request parameters



    Please find my csv data config and excel file and request parameter screenshot in attachments



    Excel file image



    CSV data config image



    Error image










    share|improve this question

























      0












      0








      0








      I was trying to read csv file using csvdata config element in jmeter so as to test multiple logins but when I try to read the value from csv file then I get inverted commas appended with respect to result. Please tell me how to get rid of these commas being passed in the request parameters



      Please find my csv data config and excel file and request parameter screenshot in attachments



      Excel file image



      CSV data config image



      Error image










      share|improve this question














      I was trying to read csv file using csvdata config element in jmeter so as to test multiple logins but when I try to read the value from csv file then I get inverted commas appended with respect to result. Please tell me how to get rid of these commas being passed in the request parameters



      Please find my csv data config and excel file and request parameter screenshot in attachments



      Excel file image



      CSV data config image



      Error image







      jmeter jmeter-plugins jmeter-4.0






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 '18 at 13:16









      keshav dwivedikeshav dwivedi

      265




      265
























          1 Answer
          1






          active

          oldest

          votes


















          0














          JMeter normally doesn't add anything to the variables, most probably you have the quotation marks in the generated CSV file, open it with normal text editor like Notepad and use find-and-replace feature to remove the quotation marks from there.





          If you cannot efficiently control the CSV data you can use __strReplace() function in order to remove the quotation marks from the variables originating from the CSV Data Set Config on the fly like:



          ${__strReplace(${Username},",,)}


          Demo:



          enter image description here



          You can install __strReplace() function as well as other Custom JMeter Functions using JMeter Plugins Manager



          enter image description here






          share|improve this answer
























          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

            – keshav dwivedi
            Nov 20 '18 at 5:18











          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

            – keshav dwivedi
            Nov 20 '18 at 5:27











          • I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

            – Dmitri T
            Nov 20 '18 at 6:16











          • I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

            – keshav dwivedi
            Nov 21 '18 at 7:35











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375478%2fgetting-inverted-commas-appended-in-request-while-reading-from-csv-in-jmeter%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          JMeter normally doesn't add anything to the variables, most probably you have the quotation marks in the generated CSV file, open it with normal text editor like Notepad and use find-and-replace feature to remove the quotation marks from there.





          If you cannot efficiently control the CSV data you can use __strReplace() function in order to remove the quotation marks from the variables originating from the CSV Data Set Config on the fly like:



          ${__strReplace(${Username},",,)}


          Demo:



          enter image description here



          You can install __strReplace() function as well as other Custom JMeter Functions using JMeter Plugins Manager



          enter image description here






          share|improve this answer
























          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

            – keshav dwivedi
            Nov 20 '18 at 5:18











          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

            – keshav dwivedi
            Nov 20 '18 at 5:27











          • I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

            – Dmitri T
            Nov 20 '18 at 6:16











          • I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

            – keshav dwivedi
            Nov 21 '18 at 7:35
















          0














          JMeter normally doesn't add anything to the variables, most probably you have the quotation marks in the generated CSV file, open it with normal text editor like Notepad and use find-and-replace feature to remove the quotation marks from there.





          If you cannot efficiently control the CSV data you can use __strReplace() function in order to remove the quotation marks from the variables originating from the CSV Data Set Config on the fly like:



          ${__strReplace(${Username},",,)}


          Demo:



          enter image description here



          You can install __strReplace() function as well as other Custom JMeter Functions using JMeter Plugins Manager



          enter image description here






          share|improve this answer
























          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

            – keshav dwivedi
            Nov 20 '18 at 5:18











          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

            – keshav dwivedi
            Nov 20 '18 at 5:27











          • I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

            – Dmitri T
            Nov 20 '18 at 6:16











          • I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

            – keshav dwivedi
            Nov 21 '18 at 7:35














          0












          0








          0







          JMeter normally doesn't add anything to the variables, most probably you have the quotation marks in the generated CSV file, open it with normal text editor like Notepad and use find-and-replace feature to remove the quotation marks from there.





          If you cannot efficiently control the CSV data you can use __strReplace() function in order to remove the quotation marks from the variables originating from the CSV Data Set Config on the fly like:



          ${__strReplace(${Username},",,)}


          Demo:



          enter image description here



          You can install __strReplace() function as well as other Custom JMeter Functions using JMeter Plugins Manager



          enter image description here






          share|improve this answer













          JMeter normally doesn't add anything to the variables, most probably you have the quotation marks in the generated CSV file, open it with normal text editor like Notepad and use find-and-replace feature to remove the quotation marks from there.





          If you cannot efficiently control the CSV data you can use __strReplace() function in order to remove the quotation marks from the variables originating from the CSV Data Set Config on the fly like:



          ${__strReplace(${Username},",,)}


          Demo:



          enter image description here



          You can install __strReplace() function as well as other Custom JMeter Functions using JMeter Plugins Manager



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 19 '18 at 13:32









          Dmitri TDmitri T

          71.8k33661




          71.8k33661













          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

            – keshav dwivedi
            Nov 20 '18 at 5:18











          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

            – keshav dwivedi
            Nov 20 '18 at 5:27











          • I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

            – Dmitri T
            Nov 20 '18 at 6:16











          • I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

            – keshav dwivedi
            Nov 21 '18 at 7:35



















          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

            – keshav dwivedi
            Nov 20 '18 at 5:18











          • I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

            – keshav dwivedi
            Nov 20 '18 at 5:27











          • I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

            – Dmitri T
            Nov 20 '18 at 6:16











          • I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

            – keshav dwivedi
            Nov 21 '18 at 7:35

















          I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

          – keshav dwivedi
          Nov 20 '18 at 5:18





          I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening

          – keshav dwivedi
          Nov 20 '18 at 5:18













          I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

          – keshav dwivedi
          Nov 20 '18 at 5:27





          I opened it using notepad and commas were there so I removed them and ran the csv again using csv datconfig but still I am getting error and login is not happening please refer links for screenshots of request image and response image which I got. Request image link:- pasteboard.co/HNZGBH1.png and response image link:- pasteboard.co/HNZH9G6.png

          – keshav dwivedi
          Nov 20 '18 at 5:27













          I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

          – Dmitri T
          Nov 20 '18 at 6:16





          I see you have the same _csrf_token value in all requests. It should not happen, this parameter needs to be dynamic, i.e. you need to extract it from the previous response using suitable JMeter Post-Processor, convert it into a JMeter Variable and replace the recorded value with the variable. Check out How to Load Test CSRF-Protected Web Sites article for more details.

          – Dmitri T
          Nov 20 '18 at 6:16













          I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

          – keshav dwivedi
          Nov 21 '18 at 7:35





          I tried by using Post processor in homepage request which executes just before login HTTP request gave regular expression for csrf token and converted csrf token into variable but still it is giving error "Csrf token failed" , please refer image for Regular expression post processor :-pasteboard.co/HO9WP3D.png and parameterization done in HTTP request :- pasteboard.co/HO9Xcnu.png and the request which is sent :- pasteboard.co/HO9XDaZ.png and the Response received which contains "Cssrf token authentication failed" message :- pasteboard.co/HO9Y6X8.png

          – keshav dwivedi
          Nov 21 '18 at 7:35




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375478%2fgetting-inverted-commas-appended-in-request-while-reading-from-csv-in-jmeter%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini