Reply
Contributor
fabianporta
Posts: 24
Registered: 01-20-2009
0
Accepted Solution

Passing two arguments (parameter and variable) to a query

I have a query that uses 2 arguments and I'm trying to call it on a loop, every step will have a different value for the second argument and the first depends from a Global Parameter.

 

This is not working... please help me with its syntax:

 

[query arq_block_sizes DL_arq_block("[param bandwidth]","[get fr_id]")]

 

Both arguments are numeric type, for example this works: [query arq_block_sizes DL_arq_block(10,2)]

 

Thanks!

 

Fabian 

Expert
KumarS
Posts: 2,233
Registered: 08-30-2008
0

Re: Passing two arguments (parameter and variable) to a query

When you put substitutions as arguments in the query command's query argument, iTest's parser seems to be sensitive to "white space" between the arguments. Just remove the whitespace between "[param bandwidth]", and "[get fr_id]" and it should evaluate fine. I will file a bug for this so that parsing of arguments is not this sensitive.
Contributor
fabianporta
Posts: 24
Registered: 01-20-2009
0

Re: Passing two arguments (parameter and variable) to a query

Hi Kumar,

 

There is no space between the arguments, just a comma. I'm sorry, but I don't understand how to solve it.

 

Thanks,

 

Fabian 

Expert
KumarS
Posts: 2,233
Registered: 08-30-2008
0

Re: Passing two arguments (parameter and variable) to a query

Here is an attached example of where I am using a query with two arguments where the first argument is a parameter and the second argument is a variable. If there is space after the comma for the arguments, iTest parser produces an error - otherwise the query command works properly.

 

To use the sample, save the testcase and the response map in the same folder in any project of your choice.

Expert
KumarS
Posts: 2,233
Registered: 08-30-2008
0

Re: Passing two arguments (parameter and variable) to a query

BTW - please post the exact error message you are getting in the testcase as well.
Contributor
fabianporta
Posts: 24
Registered: 01-20-2009
0

Re: Passing two arguments (parameter and variable) to a query

Hi Kumar,
 
I downloaded your example and it works fine. Thanks,
 
- Using $var instead of [get var] for the fr_id variable:
[query arq_block_sizes DL_arq_block("[param bandwidth]","$fr_id")]
 
No error, and it worked fine!
 
- Removing the quotes returned an error:
[query arq_block_sizes DL_arq_block([param bandwidth],$fr_id)]
 
Returned this error: Invalid query :  Expected: )

I'm using Version: 3.4.0 (Build: 39989).
 
Thanks!
 
Fabian