1

I am getting this error when I try to launch IE from selenium code.

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 800700C1 ('%1 is not a valid Win32 application.') for URL 'http://localhost:4593/'

code

public class Simple {

    public static void main(String[] args) throws IOException {

    System.setProperty("webdriver.ie.driver", "./UpdateSyncRate/Library/drivers/IEDriverServer.exe");

        WebDriver driver = new InternetExplorerDriver();
        
        driver.manage().deleteAllCookies();
        driver.get(URL);
        driver.manage().window().maximize();
    }
}

RichEdwards
  • 3,423
  • 2
  • 6
  • 22
Rajith Pv
  • 11
  • 3

1 Answers1

0

%1 not a valid win32 application makes me think there's a problem with your exe. Potential the wrong one or the wrong version?

Have a look at WebDriverManager.

Instead of downloading and mapping drivers manually, it can do it at runtime for you:

WebDriverManager.iedriver().setup();
WebDriver driver = new InternetExplorerDriver();

There's more options you can do. Have a look at their docs.

RichEdwards
  • 3,423
  • 2
  • 6
  • 22