5

I don't understand why I get the error Expected [object Undefined] undefined to be a string

Here is the script java LoginToGmail.java

WebDriver driver;
driver =new FirefoxDriver();
driver.manage().window().maximize();
driver.navigate().to("http://www.facebook.com");
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement act= driver.findElement(By.id("email"));
act.sendKeys("[email protected]");

full stack error is :

org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a
string Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800'
Capabilities [{moz:profile=C:\Users\SHEKHAR\AppData\Local\Temp\rust_mozpr‌​ofile.mipot0y6Nzs5,
rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, 
pageLoadStrategy=normal ,platform=ANY, specificationLevel=0, moz:accessibilityChecks=false,
acceptInsecureCerts=false, browserVersion=53.0, platformVersion=6.1, moz:processID=5892,
browserName=firefox, platformName=windows_nt}] 
4
  • org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a string Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800' Capabilities [{moz:profile=C:\Users\SHEKHAR\AppData\Local\Temp\rust_mozprofile.mipot0y6Nzs5, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=6.1, moz:processID=5892, browserName=firefox, platformName=windows_nt}] Commented Apr 18, 2017 at 13:01
  • I aim simply trying to open the browser and and navigate to facebook Commented Apr 18, 2017 at 13:02
  • This is due to a bug in Mozilla's geckodriver. A fix is forthcoming, but no release date is announced. Commented Apr 18, 2017 at 13:17
  • I cannot go with Mozilla and Selenium 3.0?? Please help me Commented Apr 19, 2017 at 6:26

1 Answer 1

10

To work with Selenium 3.x, Mozila Firefox 52.x you need to download the latest gecko driver from here and provide the absolute path of gecko driver as follows:

//Mozila Firefox
System.setProperty("webdriver.gecko.driver", "C:\\your_directory\\geckodriver.exe");
WebDriver driver =  new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http:\\gmail.com");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.id("Email")).sendKeys("your_id");
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.