0

How to use xpath reference name in JDBC request?below configuration i have tested but its not working. Is there any way to get this xml value[prodcutid] in to SQL Query?

Jmeter DB Request

enter image description here

XPATH Extractor

enter image description here

XML

enter image description here

1 Answer 1

1

Depending on your id column type you can do it in 2 ways:

  1. If id is VARCHAR type you will need to surround ${Productid} reference with quotation marks like:

    `SELECT * FROM prodcut WHERE id = '${productid}'
    
  2. If id is INTEGER type you will need to switch to Prepared Select Statement like:

    JMeter JDBC

Also according to documentation

Variables, functions (and properties) are all case-sensitive

so ${productid} and ${Productid} are different variables so please make sure that definition and all references are in line.

See Building a Database Test Plan and Debugging JDBC Sampler Results in JMeter articles for more information on implementing database testing using JMeter.

1

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.