Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to launch IE browser in selenium webdriver

I have written a sample code to launch IE browser and load google page.

public class Sample {

 public static void main(String[] args) 
  {
    // TODO Auto-generated method stub
    System.setProperty("webdriver.ie.driver","H:/IEDriverServer.exe");
    WebDriver driver=new InternetExplorerDriver();
    driver.manage().window().maximize();
    driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);

    driver.get("http://www.google.com");
  }
}

But when I run this script it launches browser and it gets closed immediately (less than 2 sec) without prompting any error and the script wont terminates.

This is what I can see on console screen:

Started InternetExplorerDriver server (32-bit)

2.53.1.0

Listening on port 46974

Only local connections are allowed

Can any one help me on this issue?

like image 510
Suraj Avatar asked Jul 06 '16 10:07

Suraj


People also ask

Does Selenium support IE 11?

The Selenium Project will not remove support for IE 11 when it retires but we will not actively fix issues as we have done with previous versions of IE. The Microsoft Edge team have committed to supporting IE Mode in Edge until 2029 when support for Windows 10 is retired.

Does Selenium support Internet Explorer?

What is Selenium Internet Explorer Driver or IE Driver? IE Driver is the connection that enables the users to execute Selenium test cases on the IE browser. It is an independent server that administers the open-source Selenium WebDriver Protocol.


2 Answers

Below steps are worked for me, Hope this will work for you as well:

  1. Open internet explorer.
  2. Navigate to Tools->Option
  3. Navigate to Security Tab
  4. Now for all option like Internet,Intranet,Trusted Sites and Restricted Site enable "Enable Protected" mode check-box.
  5. Set IE zoom level to 100%
  6. Click on Apply and OK
  7. Close the IE browser and run your script
like image 183
Sandeep Avatar answered Oct 31 '22 10:10

Sandeep


To execute your code in IE need to set some security setting for your browser: 1) open IE Goto tools-- select internet options-- select security Set all zones (Internet , local internet,Trusted sites,Restricted sites) to the same protected mode(enabled or disabled is no matter) 2) set the zoom to 100% : In iE browser at top right hand side corner select settings symbol. select zoom . set zoom to 100% (what ever you want like 125,200 etc) close IE. 3) If you want to see the zoom to display on the page: On the top right hand side of the browser just right click you will get some options , enable the status bar. Then you will be able to see the zoom at the rightside bottom of the page.

like image 32
kiranmai Avatar answered Oct 31 '22 09:10

kiranmai