Follow the below steps :
1) Use IE Driver Server of 32 bit instead of 64 bit.
2) Set native events to false in your desired capability while initializing Internet explorer driver object.
DesiredCapabilities capabilities = new DesiredCapabilities();
ieOptions.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
driver = new InternetExplorerDriver(capabilities);
You can also use InternetExplorerOptions class to set capabilities for driver object
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
driver = new InternetExplorerDriver(ieOptions);
Complete Example:
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;
import org.testng.annotations.Test;
public class SampleTest {
@Test
public void test_01() {
System.setProperty("webdriver.ie.driver",
System.getProperty("user.dir") + "/IEDriverServer.exe");
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
WebDriver driver = new InternetExplorerDriver(ieOptions);
driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
driver.get("http://www.google.com");
driver.findElement(By.name("q")).sendKeys("Test Selenium");
}
}
Hope this helps!
If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s automation testing certification!