1

I am using Selenium Webdriver with Java. I would like check to operation of IEdriver. The following code works fine while opening Firefox or Chrome. I want the script to work for Internet Explorer as well.

System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("www.google.com");
driver.findElement(By.name("q")).sendKeys("abc");
driver.close();

I get the following error:

Unable to find element with name == q (WARNING: The server did not provide any stacktrace information)

I got the same phenomenon, when i use xpath or id in findElement method. How can I solve this problem in Selenium WebDriver with Java? Will be grateful for any help.

giri-sh
  • 6,934
  • 2
  • 25
  • 50
Milky
  • 143
  • 4
  • 15
  • Does it open your webpage (www.google.com) and give this error or does it throw the error even before opening it? – giri-sh Sep 29 '15 at 11:18
  • Opens the website, but had not found the webelement. – Milky Sep 29 '15 at 11:22
  • Please try [Maximizing your window](http://stackoverflow.com/a/10247860/4193730) and giving an [implicit wait of 10 seconds](http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#implicit-waits) and check – Subh Sep 29 '15 at 11:26
  • Have you set the Protected Settings of each mode to same value ? [This is a must for IE-7 and higher](https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration) – Subh Sep 29 '15 at 12:03
  • @Subh Sure, i use this: `DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer(); ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); WebDriver driver = new InternetExplorerDriver(ieCapabilities);` – Milky Sep 29 '15 at 12:06
  • @Milky : Oh! Although using ["INTRODUCE_FLAKINESS_BY_IGN‌​ORING_SECURITY_DOMAINS"risks the stability of the code](http://jimevansmusic.blogspot.in/2012/08/youre-doing-it-wrong-protected-mode-and.html), but this should work. Can you please tell me which version of IE , Selenium-bindings, and IEDriverServer.exe, are you using ? I used IE-10 with Selenium 2.45.0 and IEDriverServer.exe version 2.44.0.0 ; it is working fine at my end. – Subh Sep 30 '15 at 06:55
  • @Subh Selenium version 2.47.1, IE version 10, IEDriverServer version 2.47.0.0 – Milky Sep 30 '15 at 08:56
  • Okay. I tried with your configurations with [IEDriverServer.exe of 32-bit Windows IE](http://selenium-release.storage.googleapis.com/2.47/IEDriverServer_Win32_2.47.0.zip) and it worked. **[64-bit executable is a bit problematic for IE-10/11](https://github.com/SeleniumHQ/selenium/issues/893)**. Can you please let me know if you have tried with a 64-bit IE exe or a 32-bit one ? – Subh Oct 04 '15 at 19:06
  • @Subh I have 64-bit OS. – Milky Oct 05 '15 at 08:05
  • That's fine. I am talking about the IEDriverServer.exe version. Are you using the 32-bit one or 64-bit ? – Subh Oct 05 '15 at 10:30
  • I'm using the 32-bit IEDriverServer.exe. If I use the 64-bit version of the driver, then it does not open the webpage. – Milky Oct 05 '15 at 11:29
  • Oh! There goes the last arrow in my quiver.. Sorry, I won't be of any further help. :( Hope someone helps you out here. – Subh Oct 05 '15 at 13:37

0 Answers0