IE: 11
Hi,
I have just spend 2 days trying to solve this issue.
So thought I would share the knowledge here and hopefully Ranorex will implement a better error message for this situation. (Or just make it work and not throw an exception)
Command attempted: (Any js command was throwing an error. Not just localstorage)
Code: Select all
domElement.ExecuteScript("localStorage.clear();")
Code: Select all
Action 'executescript' failed on element '{WebDocument:Google}'
at Ranorex.Core.Element.InvokeAction(String name, Object[] args)
at Ranorex.WebDocument.ExecuteScript(String code)
Code: Select all
Specified cast is not valid.
at mshtml.IHTMLDocument2.get_parentWindow()
at Ranorex.Plugin.WebFlavor.ExecuteUserScript(String code, IHTMLDocument2 rootDoc)
at Ranorex.Plugin.WebDocumentFlavorElement.InvokeAction(Element element, String name, Object[] args)
at Ranorex.Core.Element.InvokeAction(String name, Object[] args)
To cut a long story short the issue turned out to be that the Ranorex IE Plugin had become disabled on my VMs. Everything in the tests appeared to work correctly so this did not even occur to me but this is my conclusion:
Hope this helps someone if they run accross the same issue.If the IE ranorex plugin is disabled. ExecuteScript() throws this (fairly useless) exception.
Regards,
Mike