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.