Check out this code snippet:
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class PrimeFaces {
public static void main(String[] args) throws Exception {
HtmlUnitDriver htmlUnitDriver = new HtmlUnitDriver(true);
WebDriverWait wait = new WebDriverWait(htmlUnitDriver,10);
htmlUnitDriver.get("http://primefaces-rocks.appspot.com/ui/datatableComplex.jsf");
htmlUnitDriver.findElementById("j_idt44:j_idt45_row_0").click();
WebElement until = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("ui-dialog-title-j_idt44:j_idt59")));
}
}
The ID j_idt44:j_idt45_row_0 corresponds to the first row on this page:
After clicking on this row, a popup window will appear with an element having ID: j_idt44:j_idt59
The issue seems to be that the element is not visible using HtmlUnitDriver. It could be due to HtmlUnitDriver failing to click on the row or the event listener not being triggered.
Any tips on resolving this dilemma?