1

I am trying a build an automated testing framework, using Selenium WebDriver to simply login a website.

However, when I run the following code, the only thing that happens is a new internet explorer window pops up stating "This is the initial start page for the WebDriver server."

My code:

import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class WebSeleniumClient {
 public static void main(String[] args){
 File file = new File("C:\\Users\\Picheal\\Desktop\\Selenium Web Driver\\IEDriverServer.exe");
 System.setProperty("webdriver.ie.driver", file.getAbsolutePath()); 
 // Creates InternetExplorer Driver 
 WebDriver driver = new InternetExplorerDriver(); 
 //Opens Login
 for (int i = 0; i <= 500; i++){
 driver.get("https://ams2.enoah.com/Home/Login?returnurl=%2f");
 System.out.println(i);
 }
 // Finds login form and inputs credentials 
 WebElement user = driver.findElement(By.id("dnn_ctr780_Login_Login_JLSystems.NOAH_txtUsername"));
 WebElement pass = driver.findElement(By.id("dnn_ctr780_Login_Login_JLSystems.NOAH_txtPassword"));
 user.sendKeys("********"); 
 pass.sendKeys("********"); 
}

}

My console looks like:

Started InternetExplorerDriver server (64-bit)
2.47.0.0
Listening on port 63771

I usually don't ask questions but this is a just strange behavior. I believe this may be an error in eclipse. I deleted all my code, saved, and ran the same again, and still I got the same result - a new internet explorer window only.

Dhiman
4,5958 gold badges28 silver badges54 bronze badges
asked Aug 20, 2015 at 11:25
1

3 Answers 3

1

The issue is with the IE versions, your machine should be having both IE versions i.e. 32-bit and 64-bit and when you start the 'IEDriverServer.exe' it calls the 64-bit IE version while you are using 32-bit IEDriverServer.exe. I faced this issue too and observed that when any tool starts IE then 64-bit IE is launched by default (I was on Windows 7 and IE-9), because they pick default settings of the system which is usually 64-bit.

So either make 32-bit Internet Explorer default or download the 64-bit IEDriverServer.exe from Selenium Downloads and use the same.

For making 32-bit IE as default refer this link 32-bit Default IE

answered Aug 20, 2015 at 14:53
0

If test is running successfully on other browser then there is configuration issue of IE on machine.

Make sure version of Selenium, IE driver and IE browser are compatible Ref. selenium release log

Also verify required configure mentioned here

answered Aug 21, 2015 at 7:32
-1

user.sendkeys("""") won't work because type WebElement does not allow string arguments.

Other than that this works perfect in my system (Win7 64 bit).

You can try:

  1. Check the versions of your Eclipse and IEDriver to check whether they are 32/64 bit as others have said here.
  2. Try using Capabilities class for your IEDriver.
Kate Paulk
31.5k8 gold badges56 silver badges109 bronze badges
answered Feb 19, 2016 at 7:03
3
  • why the down vote? is it because I havent typed it ''neatly''. lol..this community. I am so tired. Commented Feb 19, 2016 at 10:41
  • All I missed was some spaces, i think. I am no longer going to post anything until i feel its abs necessary Commented Feb 19, 2016 at 10:43
  • You haven't really explained how the Capabilities class will help the poster. I've cleaned up your format and grammar a bit to make your answer a bit easier to understand, but you really need to show how your suggestions will help: indicate what the OP should be doing instead of WebElement.SendKeys("*****") and give an example of using the Capabilities class. Commented Feb 19, 2016 at 12:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.