I have the following problem.
I have a website where the Login is Via a Link that has the href: SubmitLogin().
I'm trying to use webdriver in the form of PageFactories.
I have this method:
usernameField.sendKeys(username);
passwordField.sendKeys(password);
Reporter.log(String.format("Login with user:%s", username));
Reporter.log(String.format("Login with password:%s", password));
//signInLink.click();
//JavascriptExecutor js = (JavascriptExecutor) driver;
//js.executeScript("SubmitLogin");
signInLink.click();
return PageFactory.initElements(driver, AdminHomePage.class);
As you can see I also tried executing the script directly, but it's no good.
The Page isn't doing anything. I have Javascript enabled and I'm using webdriver with HtmlUnitDriver. Like this:
WebDriver webDriver = new HtmlUnitDriver(true);
The true means that Javascript is enabled.
In the log I can't see any problems. The two fields are set correctly, it finds all the necessary elements it just does nothing. :(
In the log I can see a LOT of css warning and a bunch of severe errors stating that some javascripts failed to execute but none mention SubmitLogin. It just seams that doesn't even reach it or whatever. :S
There is no error on the Page.
I want to use HtmlUnitDriver because this will be running on a desktop less build machine.
Additional Information: It's HTTPS. And also, FirefoxDriver with custom profile handles it just fine. I just would like to use HtmlUnitDriver...
Any ideas? :S
Thanks!!