-1

I want to use PAGE_LOAD_STRATEGY strategy while launching IE driver by using the following code but I'm facing a deprecation issue for InternetExplorerDriver. What's the reason for it?

DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability(CapabilityType.PAGE_LOAD_STRATEGY, "none");
    WebDriver driver = new InternetExplorerDriver(caps);

InternetExplorerDriver is crossed out as indicated in the screenshot.

Deprecation

3
  • 1
    Did you read the docs or source for that class? If it's marked as deprecated, there's usually an explanation or alternative: seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/…
    – jonrsharpe
    Jul 28 '19 at 9:49
  • Yes, i did and it didnt work for me. how can i get rid of this deprecated issue ? how should i type the code to handle it
    – santino87
    Jul 28 '19 at 12:59
  • What do you mean it didn't work? What did you change? What happened?
    – jonrsharpe
    Jul 28 '19 at 13:02
0

The docs say you have to instantiate the driver with a different argument type: InternetExplorerOptions:

enter image description here

InternetExplorerOptions have a method called setPageLoadStrategy:

InternetExplorerOptions options = new InternetExplorerOptions().setPageLoadStrategy(PageLoadStrategy.NONE);

You can find all strategies here.

0

Try this

System.setProperty("webdriver.ie.driver", "C:\\Users\\Downloads\\Selenium\\IEDriverServer_x64_3.150.1\\IEDriverServer.exe");

InternetExplorerOptions options = new InternetExplorerOptions().setPageLoadStrategy(PageLoadStrategy.NONE);

options.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);

WebDriver driver=new InternetExplorerDriver(options);
driver.get("https://www.google.com/");
1
  • Please also try to explain why your solution solves the problem.
    – pavelsaman
    Jul 21 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.