Completed
Last Updated: 28 Feb 2017 16:05 by ADMIN
Richard
Created on: 08 Feb 2017 14:10
Type: Feature Request
0
Set variable does not get set since last update
Hello,

Yesterday I updated Telerik API to version 2017.1.207.0 and I now seem to have trouble getting the Bearertoken set using Set Variable.

The Set Variable step is defined as

Source: Body     JSONPath     acces_token
Variable: Bearertoken
Convert to: none
Target  Level: Test

which worked fine with the Response Body in an earlier step that returned the AccessToken

{
"access_token":"xxxx",
"token_type":"bearer",
"expires_in":3599
}

which resulted in setting the Bearertoken as "xxxx"

Since the update the Bearertoken does not get set (=empty). This is probably due to a new validation of the JSON path: "The path is not a valid Jsonpath" ?
However, if I change JSONPath to $.access_token the bearertoken still does not get set (=empty).
Please advise on how to get this working again. It blocks running my testcases.
4 comments
ADMIN
Shtilianov
Posted on: 28 Feb 2017 16:05
Issue is fixed and will be available with the next internal build by the end of March.
ADMIN
Oleg
Posted on: 10 Feb 2017 09:10
Hi,

Thank you for the confirmation! Please excuse us for the inconvenience this causes you.
Richard
Posted on: 10 Feb 2017 08:59
Hello,

Thanks! Indeed when I run the whole test/project, the variable gets set correctly.
ADMIN
Oleg
Posted on: 09 Feb 2017 15:11
Hello,

Thanks for reporting the issue. 

Indeed, "$.access_token" is the correct syntax that should work in your case. The "access_token" will not be accepted as a correct JsonPath expression by version R1 2017 or later. (It was a side effect in the previous versions that "access_token" was accepted.)

As for why the "$.access_token" path expression does not work: we investigated it today and we managed to reproduce it. It happens though only if the Source variable used in the Set Variable step is Body or RequestBody (other sources work well). Also, this reproduces only if you are running a single Set Variable step (if you run the whole test or project, it works well).

We logged the issue for fixing.

Please let us know if your scenario is different. If you reproduce the issue while running a whole test/project, that means there is another problem, that we do not reproduce so far. (In that case we would appreciate it if you could send us a sample project where the problem reproduces.)

If that is exactly what happens on your side, please run the whole test/project instead of running the single step until we provide a fix for the issue.