Hi Community,
I have simple JSON object stored as variable created by javascript
S(JSON.stringify(Paths));
which contains http links
e.g.
[{“fullPathInitialise”:“http://11.111.11.11:1111/rr/initialise/201806BC11”}]
edit: I have created a fake api if u want to access the json above
http://www.mocky.io/v2/5b164b7631000094006f3ddc
which I am tryng to access with http-connector
and in the input Parameters section
in the URL part I have java script which tries to access the above json spin with the following code
var system = java.lang.System;
var json = execution.getVariable("oskarPaths");
var test = json.elements().get(0);
var test2 = test.prop("fullPathInitialise").value().toString;
system.out.println('fullPathInitialise: '+test2);
test2;
I have tried to change the value() to toString but still getting errors like
jdk.nashorn.api.scripting.ScriptObjectMirror cannot be cast to java.lang.String
Can you please give an advice how to access a prop from the json [].
thx.