1

I am login into google plus using selenium htmlunit driver. below code is working fine with fireFox driver. When I use HtmlUnitDriver, it gives some error like "Bad input type:"

HtmlUnitDriver driver = new HtmlUnitDriver(true);
driver.setJavascriptEnabled(true);
driver.get("https://plus.google.com");
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
driver.findElement(By.id("Email")).sendKeys("hjhj@gmail.com");
driver.findElement(By.id("next")).click();
driver.findElement(By.id("Passwd")).sendKeys("qwert");
driver.findElement(By.id("signIn")).click();
driver.manage().timeouts().implicitlyWait(1, TimeUnit.MILLISECONDS);

can anyone tell me how I can achieve this?

Kishore
  • 5,761
  • 5
  • 28
  • 53

1 Answers1

1

From trying your code I saw a message that matched your description.

Mar 01, 2016 11:39:28 AM    com.gargoylesoftware.htmlunit.html.InputElementFactory createElementNS
INFO: Bad input type: "email", creating a text input

HtmlUnit likes to fill the console up with logging, if you add these lines

java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF); 
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");

In the static or main it will turn of the logging from htmlunit (or see this question)

Community
  • 1
  • 1
A_Test
  • 19
  • 2