Closed ec-wagner closed 5 years ago
Use your own notes for this.
And yes, the keyword returns a list because JSONPath can match multiple. So one does not need check whether it is a single value or a a list, which would require too much keywords on the .robot
side.
Please submit a Pull Request if one has a solution for this.
I was trying to store the result from the
String
keyword in a variable for further usage before I realized that it returns a list. I think it's not a real issue but it's not obvious that it returns a list without looking at the code of the keyword's implementation. Just want to share my experience in case somebody runs into it, too - and for my future me in case I run into it again :rofl:Example:
${token}
contains some characters which I did not expected to be there:[' ... ']
Now that I know that
String
returns a list here is how the above should be done rightStore the result in a list variable
@{token}
and access the value at index 0 -->@{token}[0]
then I get what I actually wanted:eyJhbGciOiJSUzI1NiIsImt...
- the token as a string.Cheers