Selenium WebDriver - not fetching datas from excel

303 views Asked by At

I am testing a website using Selenium WebDriver.

Eclipse has to fetch data from excel and enter it in the respective fields. But it is not doing so.

code:

driver.findElement(By.Id("address")).clear();
driver.findElement(By.Id("address")).sendKeys("111, A Street");
1

There are 1 answers

0
tim-slifer On

@VAnrei makes a good point. We'll need to see a fair amount of more code to be really helpful.

On another note, if you're trying to pull data from an Excel sheet and having trouble, check out a library called ExcelUnit (http://sourceforge.net/projects/excelunit/). There's a bit of documentation out there, but it's pretty easy to use. I haven't tried it with TestNG, though, on the chance that's what you're using.

ExcelUnit will do all the heavy lifting for you when it comes to parsing Excel data and passing into your test. All you have to do is configure it and build your data sets.