Is there anybody know how to get info from browser SessionStorage using C# code into Ranorex?
I would need some information present in the current browser "Window.SessionStorage", but I am not able to get them except using browser devtools console.
I tried to google it, but I found only few indication about httpcontex method of System.Web namespace, but I am not able to get that package using nuget and so I have not been able to further investigate.
Is there anyboy here could help me in this?
Thank you in advance.
Browser SessionStorage
Re: Browser SessionStorage
Hi mafi,
how about calling some javascript via your WebDocument?
Let's give it a try!
Greetings,
Gyuri
how about calling some javascript via your WebDocument?
Code: Select all
var repo = yourAppRepository.Instance;
var webDocument = repo.yourApp.Self;
string script = "sessionStorage.setItem('myKey', 'myValue');"; // script to add value to the storage
webDocument.ExecuteScript(script);
script = "return sessionStorage.getItem('myKey');"; // script to get value from the storage
string value = webDocument.ExecuteScript(script);
Report.Info(value); // myValue
Greetings,
Gyuri
Re: Browser SessionStorage
Thank you for the assistance. I really appreciate it. click here