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

asked Jun 5, 2017 at 6:48

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.

answered Jun 5, 2017 at 7:37
1
  • If id is BIGINT in prepared select statement, error message given --> For input string: "${productid}". how to fix this? sqa.stackexchange.com/questions/27605/… Commented Jun 5, 2017 at 12:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.