I am using webdriver on IE11. And per selenium there are a set of required setting to run in IE11 one of them is to disabled \"enhanced protected mode\" in Internet Option > Adv
Please try to use the InternetExplorerOptions object and set the IntroduceInstabilityByIgnoringProtectedModeSettings property to true in C# application, code as below:
private const string URL = @"https://www.bing.com/";
private const string IE_DRIVER_PATH = @"E:\webdriver\IEDriverServer_x64_3.14.0"; // where the Selenium IE webdriver EXE is.
static void Main(string[] args)
{
InternetExplorerOptions opts = new InternetExplorerOptions() {
IntroduceInstabilityByIgnoringProtectedModeSettings = true,
IgnoreZoomLevel = true,
};
using (var driver = new InternetExplorerDriver(IE_DRIVER_PATH, opts))
{
driver.Navigate().GoToUrl("https://www.bing.com/");
//someTextbox.SendKeys("abc123");
var element = driver.FindElementById("sb_form_q");
var script = "document.getElementById('sb_form_q').value = 'webdriver';";
IJavaScriptExecutor jse = (IJavaScriptExecutor)driver;
jse.ExecuteScript(script, element);
//element.SendKeys("webdriver");
element.SendKeys(Keys.Enter);
}
}
If you application is a Java application, try to use the following code:
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability("nativeEvents", false);
cap.setCapability("unexpectedAlertBehaviour", "accept");
cap.setCapability("ignoreProtectedModeSettings", true);
cap.setCapability("disable-popup-blocking", true);
cap.setCapability("enablePersistentHover", true);
cap.setCapability("ignoreZoomSetting", true);
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
InternetExplorerOptions options = new InternetExplorerOptions();
options.merge(cap);
WebDriver driver = new InternetExplorerDriver(options);
Code from this link.