I'm working with Selenium Web Driver, with both Chrome and HTMLUnit. With Chrome, the following code works, but HTMLUnit returns an error saying that the element couldnt be found.
SeleniumUtils.goURL(driver, "https://someweb.com");
Thread.sleep(3000); //Added just in case it was loading time
List<WebElement> list = SeleniumUtils.getElements(driver, TrackingPage.getTableContent());
That last line will return null, with no elements found. The XPath used is :
return By.xpath("//*[@id=\"__xmlview1--idProductsTable-tblBody\"]/tr");
Works with Chrome, fails in XPath with HTMLUnit. Any idea?
The driver used is created like this:
HtmlUnitDriver driver = new HtmlUnitDriver();