Search Here!

Saturday, February 16, 2013

Webdriver Ignoring UnexpectedAlertBehavior and Zoom Level

With 'UnexpectedAlertBehavior' option we can do any work in front like chatting while in background window scripts are executing and 'IgnoreZoomLevel ' we can also run scripts at any zoom level.

InternetExplorerOptions options = new InternetExplorerOptions

                                                  {
                                                      IntroduceInstabilityByIgnoringProtectedModeSettings = true,
                                                      UnexpectedAlertBehavior = InternetExplorerUnexpectedAlertBehavior.Ignore,
                                                      IgnoreZoomLevel = true                                                     
                                                  };
IWebDriver webDriver = new InternetExplorerDriver(ieDriverPath, options, TimeSpan.FromMinutes(10));            webDriver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(timeOut));
return webDriver;

No comments:

Post a Comment