Topic for comments about Browser library keyword LocalStorage Set Item
We are unable to set a value that contain double quotes, as for example a JSON string.
${example_token}= set variable [{“NAME”,“VALUE”}]
LocalStorage Set Item TokenManager.profiles ${example_token}
The following error message appears:
Suspended due to logged failure: Error: page.evaluate: SyntaxError: missing ) after argument list
at eval ()
at UtilityScript.evaluate (:197:30)
at UtilityScript. (:1:44)
What do we need to change to make this possible? We could really use some help here
@jessicavanunen, stumbled across same error while trying to put json in local storage. Solved it by replacing "
with \\"
.
Full example:
${settings} Create Dictionary
... cookies=${True}
... region=global
${json} Set Variable ${{json.dumps($settings)}}
${json} Replace String ${json} " \\"
LocalStorage Set Item
... key
... ${json}