[myParam variable structure]
I got a Map<String, Object> return from a command, it is a kind of Map<key, value>.My problem is looks simple, but it have taken me 4 days, I cannot get or set the content of "value" key. Below is my variable that I debug in Java, it looks like (you can see my screen shot for more visual)
myParam
-[0]
--key: "value"
--value: CharSequence[1]
---[0]: "abcdefghijkl" <--- I need to change this
-[1]
--key:"id"
--value: 152438043653703040
My intenstion is change or get the value of "value" key, so I just set/get by myParam.put("value","new content")
But Java always changes the text CharSequence1, not the text "abcdefghijkl".
Could you please tell me how to get or set the text "abcdefghijkl". All what I want is changing the text "abcdefghijkl" to a new text.
All things I have done so far but still not get it works:
myParam.get("value")
, the string return still is CharSequence refer scereenshotmyParam.put("value","new content")
, it will change CharSequence to "new content", this is absolute not my demandPlease help me out of this situation. it drives me crazy now. Thank you so much.
It looks that you are trying to access value to be passed in sendkeys element command. If you see signature of sendkeys it has optional array of CharSequence
. So as value you Will get array of CharSequence
.
To get value
CharSequence val = ((CharSequence [])myParam.get("value"))[0];
To set value
((CharSequence [])myParam.get("value"))[0]="new content";