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.
Class library usage, coding and language questions.
2 posts • Page 1 of 1
Let's give it a try!
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