I have written a sample code to launch IE browser
and load google page.
public class Sample {
public static void main(String[] args)
{
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:
System.setProperty("webdriver.ie.driver", "C:/Drivers/IEDriverServer.exe");
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability("ignoreZoomSetting", true);
driver= new InternetExplorerDriver(capabilities);
driver.manage().window().maximize();
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.... :)
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.
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.
Below steps are worked for me, Hope this will work for you as well:
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
for 32-bit Windows :- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
for 64-bit Windows :- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
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..:)
package tests;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Sample {
public static void main(String[] args) {
System.setProperty("webdriver.ie.driver","C:\\Automation Workspace\\ComplianceDashboardProject\\Vendor\\IEDriverServer.exe");
WebDriver driver=new InternetExplorerDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
driver.get("http://www.google.com");
driver.quit();
}
}
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.