Send parameters to Query and Compare Query

If you need to send parameters to queries, for example to filter results by some external value, you can use Query Parameters.


Designing Queries with parameters

Query parameters are added to queries on the format: {@parametername[default value]}.

The default value is only used when testing the query in exMon Administrator.

You can add multiple parameters and reuse the same parameter.
In the example below we select products by color and price range and when testing it in exMon Administrator we select black products that cost between 0 and 200.

If you are using query parameters with tests that use exception management, it is important to deselect “Automatically close exceptions when they are not found in query results” by going into Advanced in Exception Management Properties.


Running Queries with parameters on the Portal

When executing the test from the portal, the user will be asked to fill in query parameters.



Running Queries with parameters with epcmd.exe

Queries that define parameters must be executed with parameters in the command line.

For example to execute the query above:

epcmd --query 1 --@color "Black" --@pricefrom 0 --@priceto 200


Adding to Object Groups

You can add the same query multiple times into object group to run with different parameters.

exMon Contact Us