swd-recorder icon indicating copy to clipboard operation
swd-recorder copied to clipboard

Javascript error: IEDriver on Protect mode OFF

Open MonoAutomation opened this issue 9 years ago • 6 comments

HI,

Due to security reasons and no admin rights, i tried to handle IE protect mode through script but which was failed to run using the tool.

After i handled IE protected mode through the code , tool giving java script error when i try to perform Ctrl+Right click on any element.

The below changes i did to run on IE, var options = new InternetExplorerOptions(); options.IntroduceInstabilityByIgnoringProtectedModeSettings = true; options.InitialBrowserUrl = "https://google.com"; driver= new InternetExplorerDriver(options);

after this change, i was able to invoke internet explorer but not able to locate any element,and saw the above explained error message.

Note: Working fine on firefox. iejscripterror

Thanks In Advance.

MonoAutomation avatar Feb 08 '16 06:02 MonoAutomation

Hi RaviAutomation, This is why the setting IntroduceInstabilityByIgnoringProtectedModeSettings has this long name ;)

Could you please take a look (and send a screenshot if possible) to the F12 Internet Explorer Console? There should be an error after you started WebElementExplorer or after you performed Ctrl+RightClick.

If that would be a SECURITY error, I am afraid nothing can be done, but let's see.

@dzhariy

dzharii avatar Feb 08 '16 08:02 dzharii

Please find the attachments.

capture IEscript.txt

MonoAutomation avatar Feb 08 '16 09:02 MonoAutomation

Hi @RaviAutomation,

I think I have found the cause of the issue.

As a hotfix, could you please REPLACE the file: SwdPageRecorder_Latest\JavaScript\ElementSearch.js with the file, provided in the following gist: https://gist.github.com/dzharii/137fef8e3f330ca8801b

the cause was a javascript call to the constant that does not exists in IE8. Your screenshot helped to reproduce the issue, please check if web element explorer works on your side after you have applied the hot-fix

dzharii avatar Feb 09 '16 04:02 dzharii

Yes, its resolved and able to see element explorer but created new issue. after created element explorer, when i clicked on the 'REFRESH' button getting java script error.please find the screenshot. refresherror

MonoAutomation avatar Feb 09 '16 07:02 MonoAutomation

Sorry, @RaviAutomation I am unable to reproduce this issue.

Do you use IE8 or had it happened on other browser? I'll try to experiment with the javascript executor to provide more reasonable error messages. For now I am not sure what had happened at all O_O

dzharii avatar Feb 11 '16 05:02 dzharii

Its happening only for IE8,but working fine on Firefox.me too trying to get to know...am thinking its bcz of protect mode is hadling through script,instead of browser settings level.

MonoAutomation avatar Feb 11 '16 17:02 MonoAutomation