0

I am using selenium to autofill the form fields through internet explorer.But what is happening it is taking to long to fill the required fields. Is there any way by which we can increase the speed. Here is the code:

System.setProperty("webdriver.ie.driver","C:\\Users\\mayank\\Desktop\\IEDriverServer.exe");
WebDriver driver=new InternetExplorerDriver();
driver.get("http://online.newindia.co.in");
driver.findElement(By.name("loginid")).sendKeys("abc");
driver.findElement(By.name("password")).sendKeys("xyz");
driver.findElement(By.id("login")).click();
Mayank Vaid
  • 330
  • 1
  • 7
  • 18
  • Please refer to a similar question answer in this [link](http://stackoverflow.com/questions/30979069/webdriver-taking-too-much-time-to-execute-the-script-in-if-block-using-java).Hope this helps! – Sunil Dabburi May 20 '16 at 06:05
  • Actually the letters are taking much time to get typed in textboxes...I need to speed up their filling – Mayank Vaid May 20 '16 at 06:13
  • 1
    What about this thread: http://stackoverflow.com/questions/27985300/selenium-webdriver-typing-very-slow-in-text-field-on-ie-browser – Sunil Dabburi May 20 '16 at 06:15
  • Can you mark the comment useful? Thanks – Sunil Dabburi May 20 '16 at 06:45
  • one more problem that i am facing is after logging the next page takes time to load and in the meanwhile error comes up as the desired element with desired id is not found. Plz suggest solution. – Mayank Vaid May 20 '16 at 07:10
  • 1
    Use WebDriverWait wait = new WebDriverWait(driver, 20); wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@id='address-0']/span"))); – Kishan Patel May 20 '16 at 07:11
  • Thanks...it worked – Mayank Vaid May 20 '16 at 08:04

1 Answers1

-1
DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
ieCaps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);


ieCaps.setCapability("requireWindowFocus", true);
driver = new InternetExplorerDriver(ieCaps);

add these four lines

Derrick
  • 3,669
  • 5
  • 35
  • 50