I am trying to execute the web script in IE browser but I got this error? can any one provide the solution.
Please refer the code :
import org.openqa.selenium.;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class demo3 {

public static void main(String[] args) {
    // TODO Auto-generated method stub

    System.setProperty("webdriver.ie.driver", "C:\work\MicrosoftWebDriver.exe");
    WebDriver driver= new InternetExplorerDriver();     
    driver.get("http://www.msn.com");
    System.out.println(driver.getTitle());
    System.out.println(driver.getCurrentUrl());




}

}

Getting Error in console and have also attached the screen shot :
Aug 12, 2018 8:52:17 PM org.openqa.selenium.os.OsProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Execution (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “C:workMicrosoftWebDriver.exe” (in directory “.”): CreateProcess error=193, %1 is not a valid Win32 application)
Exception in thread “main” org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: ‘3.13.0’, revision: ‘2f0d292’, time: ‘2018-06-25T15:32:14.902Z’
System info: host: ‘GITANJALI-PC’, ip: ‘192.168.0.12’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘10.0.2’
Driver info: driver.version: InternetExplorerDriver
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:193)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:179)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:221)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:213)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:150)
at demo3.main(demo3.java:10)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:42885/status] to be available after 20007 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:188)
… 8 more
Caused by: java.util.concurrent.TimeoutException
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
… 9 more



Source link https://sqa.stackexchange.com/questions/35188/failed-to--ie-driver-using-selenium-webdriver

LEAVE A REPLY

Please enter your comment!
Please enter your name here