Search code examples
jdbcjmeter

How to use var.get in JDBC in Jmeter


I have a question about jdbc in jmeter, I have a value (employee), that I want to check if it exists in a list. i try to perform a query to DB and to use var.get function, is it possible? it only worked when I use ${value}. is it possible to use var.get?

in the test I try to perform call and check if employee exists in test_case_string_employee.

select count (*)
from employee
where CreatedAtDate ='today'
and employee IN ${test_case_string_employee};

the code is working. but can I change what is after the "IN"?

I tried

IN 'vars.get("test_case_string_employee")';

and

IN vars.get("test_case_string_employee");

and got exceptions regards


Solution

  • vars.get only works in scripting elements (jsr223, beanshell).

    In other test elements, you need to use:

    ${}