Forum Discussion

kailashlatad's avatar
kailashlatad
Occasional Contributor
5 years ago
Solved

How to pass value from properties in query parameter ?

Hi All,

 

I am trying to pass value from propeerties in query parameter using ${Properties#Type} in get request, but when i am giving ${Properties#Type} the same content is passing while sending request. Can anyone help me please in this issue?

 

I want to pass diffrent values in query parameter through properties and the value will load in properties at the run time while execution test suite from excel sheet.

  • If you are asking about passing a property value to a Query in JDBC Request then your approach is correct. Its just that if query parameter type is string then use single quotes otherwise use property as is. Below is simple example:

     

    SELECT *
    FROM EMPLOYEE 
    WHERE LAST_NAME = '${EMP_DTL#LAST_NM}' AND
    EPMPLOYEE_ID = ${EMP_DTL#EMPID)

     

    In this example EMP_DTL is Properties step where LAST_NM and EMP_ID are properties stored in. Hope this help resolving your issue. Accept this as solution if this really helps or provide more details on what you are trying to achieve with details explanation of your tests.

     

    Thanks

3 Replies

  • shishija's avatar
    shishija
    Occasional Contributor

    If you are asking about passing a property value to a Query in JDBC Request then your approach is correct. Its just that if query parameter type is string then use single quotes otherwise use property as is. Below is simple example:

     

    SELECT *
    FROM EMPLOYEE 
    WHERE LAST_NAME = '${EMP_DTL#LAST_NM}' AND
    EPMPLOYEE_ID = ${EMP_DTL#EMPID)

     

    In this example EMP_DTL is Properties step where LAST_NM and EMP_ID are properties stored in. Hope this help resolving your issue. Accept this as solution if this really helps or provide more details on what you are trying to achieve with details explanation of your tests.

     

    Thanks

  • nmrao's avatar
    nmrao
    Champion Level 3
    Could not understand the issue.

    Do you mean to say, if you use ${Properties#Type}, it is not working?

    Can you give high level view of what you are doing?
    • kailashlatad's avatar
      kailashlatad
      Occasional Contributor

      Hi Rao,

      Issue is resolved now .. values are getting loaded now from property . 

       

      Thank You,

      Kailash Latad