0

enter image description hereenter image description hereenter image description here My scenario Step1: I have set http request for my variable and values are

     courseid = ${courseid}            
     priceid = ${priceid}                     
     coursecategoryid = ${coursecategoryid}..            
     .....etc         

    Step2: I have set my regular expression extractor is

    1) courseid

    Reference name: Courseid               
    Regular expression: courseid=(.+?)&          
    Template: $0$             
    Mathch No: 0                

    2)Price id              
    Reference name: Priceid                 
    Regular expression: priceid=(.+?)&                       
    Template: $0$                   
    Mathch No: 0     

    3)coursecategory id                       

    Reference name: Coursecategoryid               
    Regular expression: coursecategoryid=(.+?)&                  
    Template: $0$                 
    Mathch No: 0                  

    My result is showing below error in view result tree

http://192.168.2.41:8092/ecloudbaseweb//app/managecourseinfo?courseid=${courseid}&coursetitle=Maths&coursesubtitle=&coursedescription=Maths&coursegoal=Maths&coursepromevideopath=815%2Fpromovideo%2Ffile_19_Sep_2016_16_05_32_Promovideo.mp4&priceid=${priceid}&price=0&coursecategoryid=${coursecategoryid}

Kindly give me a solution for how can i using dynamic parameter for this scenario and kindly refer the snapshots
4
  • Why do you use Template: $0$ and Match No: 0? You are supposed to need $1$ in Template (first group of regex, a value in your parentheses). And Match No: 0 - is a selecting of Random value (in the case of multiple matches of regex in a source string. Possibly, you can use just a Match No: 1 - first match). Could you please attach your jmx-scenario? And what do you parse with regular expressions? Commented Sep 21, 2016 at 6:28
  • By the way, reference name is case sensitive. So Reference name: Coursecategoryid is a ${Coursecategoryid}, not a ${coursecategoryid} Commented Sep 21, 2016 at 6:53
  • i have updated you mentioned parameter details...but, the same error occurred... Commented Sep 21, 2016 at 7:11
  • Good, and your regular expression extractor, please. Commented Sep 21, 2016 at 9:03

1 Answer 1

1

I would recommend to follow these steps to find and fix the problem:

  1. Add Debug Sampler - to know which values are captured using regular expression extractor.
  2. If you are capturing more than one value from single response (using multiple groups), Follow the steps mentioned in the following post to check/confirm whether you are using regular expression in right manner: using Regular Expression Extractor to capture multiple values
  3. Run the script and check the debug sampler (in View Results Tree) for the values retrieved by Regular Expression Extractor

Note: Regular Expression Extractor should be added as a child of the sampler, in which response regular expressions should be applied.

Note: Reference names used in regular expression are case-sensitive.

Note: If a single group captures more than one value, then specify index which value to be used in the request. match 0 - random value, match n - value in 'n' index.

Eg: Suppose Regular expression: courseid=(.+?)& , captures more than one courseid from the response, then you need to specify the match to retrieve specific value. Check Debug Sample result to know the values captured using View Results Tree.

Edit:

As you are naming "Reference Name" as 'Courseid' but using it as '${courseid}', it won't match. Use '${Courseid}', i.e., upper case 'c'.

Reg Expr Extractor:

enter image description here

Usage:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.