-1

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");
sushain97
  • 2,752
  • 1
  • 25
  • 36
ck1711
  • 7
  • 1
  • 1
    As far as I see you pasted a small fraction of code that writes the address into a field. What's the code that should fetch data from Excel ? – VAndrei Nov 19 '14 at 21:41
  • Please refer exact code below : http://www.ontestautomation.com/data-driven-testing-in-selenium-webdriver-using-excel/ – Helping Hands Nov 20 '14 at 05:36

1 Answers1

-1

@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.

tim-slifer
  • 1,068
  • 1
  • 9
  • 17