Internet Explorer Protective mode setting and Zoom levels

后端 未结 1 478
迷失自我
迷失自我 2020-11-29 13:39
using System;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium;

namespace CSharpAutomationFramework.Tests
{
        public class Browse         


        
相关标签:
1条回答
  • 2020-11-29 14:24

    While working with Selenium 3.x, IEDriverServer 3.x and Internet Explorer you can't ignore Zoom Levels and Protective Mode settings.

    If you look into the Required Configuration of Internet Explorer Driver the following points are clearly mentioned :

    Protected Mode

    On Internet Explorer 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings you have to choose "Internet Options" from the "Tools" menu and then click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled Enable Protected Mode.

    @JimEvans in his article You're Doing It Wrong: IE Protected Mode and WebDriver clearly mentions :

    Using the capability doesn't solve the underlying problem though. If a Protected Mode boundary is crossed, very unexpected behavior including hangs, element location not working, and clicks not being propagated, could result. To help warn people of this potential problem, the capability was given big scary-sounding names like INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS in Java and IntroduceInstabilityByIgnoringProtectedModeSettings in .NET. We really thought that telling the user that using this setting would introduce potential badness in their code would discourage its use, but it turned out not to be so.

    Browser Zoom Level

    The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.


    Solution

    As per the Required Configuration of Internet Explorer Driver :

    • Set/Unset the Protected Mode settings to the same level for all the Zones.
    • Set the Browser Zoom Level to 100%
    0 讨论(0)
提交回复
热议问题