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?
I completely agree with sandeep's solution along with that for setting zoom level to 100% permanently i am adding few code lines as i faced issue to set this.
These are the code lines i found after i browsed for the zoom level 100% error:
For the security settings to execute code through IE : follow the steps in this link.` 'http://www.seleniumeasy.com/selenium-tutorials/how-to-run-webdriver-in-ie-browser'
Hope this solution helps you.... :)
I did the above and got it to work. Maybe try moving your driver file to another location to make sure there isn't some security issue.
Disabled JavaScript on IE can cause the test to not run.
I keep reading answers to set security setting to anything as long as it's consistent, but I find it's best to set them all to Medium, as this security level won't disable JavaScript. But in any case, if one has this issue, he can choose "Custom level..." for the "Internet" option in the Security tab, and make sure that "Active Scripting" under "Scripting" is enabled.
Of course, first make sure to complete all the steps in the IEDriver docs.
try:
If your
IE
version is 11, There are following steps to resolve it :-create a DWORD value with the name "iexplore.exe" and the value of 0 in the following key
If still getting the problem Add domain to list of "Trusted Sites" for i.e. in "Internet Options" (https to trusted sites, and http to local intranet).
Hope it will help you..:)
Below steps are worked for me, Hope this will work for you as well: