1

I want to update the test results of Cucumber test scenarios to QC ALM using Rest API. I have individual test-set for all automation test scenario (There is a 1-1 mapping between automation test scenario name and test-set name). So to get the test-set id for particular automation scenario, I am calling the rest API through Java.

http://xxxx/qcbin/rest/domains//projects//test-set-folders?query={name['Test']}

while executing this above with get method, I am getting the below error:

qccore.general-errorIllegal query expression: must be surrounded with curly brackets

The GET method works fine, if I have query like this:

?query={id[123]}

The ALM version is 11.52.536. Please help to solve this.

8
  • Try to amend singlequotes to doublequotes in your query.
    – Alexey R.
    Sep 13 '17 at 13:26
  • 1
    I believe the real case is not about "Test" name, there should be either whitespaces or some special characters vreaking the query grammar
    – Alexey R.
    Sep 13 '17 at 13:40
  • 1
    Hi Alex, I have tried that already (with single quote, double quote and without any quote. But every time getting the same error. Sep 13 '17 at 14:04
  • What is the exact value you're passing to the failing query?
    – Alexey R.
    Sep 13 '17 at 14:12
0

Pretty late, but if anybody needs this, the problem is with the URL encoding, use %20 instead of white spaces.

For example with "Sprint 2" the URL would be: http://xxxx/qcbin/rest/domains//projects//test-set-folders?query={name["Sprint%202"]} This also affects other special characters, like # (which is %23)

I use this page to verify those simbols: https://www.w3schools.com/tags/ref_urlencode.asp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.