I had to make chrome browser headless after which when I try to see the html code by executing below lines
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
ldriver = new ChromeDriver(options);
String stored_Text = ldriver.getPageSource();
System.out.println(stored_Text);
Output is:
<html><head></head><body></body></html>
Because of which when I write xpath after making the page headless I'm getting no such element exception
Is there a way for me to circumvent this problem. Please help