I am trying to get html content of an html tag using HtmlUnitDriver. The code i have written is:
WebElement table_element = wd.findElement(By.id("genericTableFormtable"));
String str=table_element.getAttribute("outerHTML");
int index=str.indexOf("active");
If I use ChromeDriver then i get the code in the str, but if I use HtmlUnitDriver then I get an exception in my further code as str is null. Please tell why this is happening