I am trying to invoke a locally stored html file using the get() method of the HtmlUnitDriver, but the page is not getting loaded. I tried to get the page source and I got 404 not found as the response. If I use the chrome driver in headless mode I am able to invoke the file. Is it possible to do this using HtmlUnitDriver?
Below is a code snippet
HtmlUnitDriver unitDriver = new HtmlUnitDriver();
public class Test {
public void clickOn() {
String filePath =
"home/test-output/100071234.html";
try {
unitDriver.get(filePath);
WebElement ele = unitDriver.findElement(By.id("submitPayment"));
ele.click();
} catch (Exception ex) {
ex.printStackTrace();
}
}