I have a html string (can not write it to file) in memory, I want to render the html string in Selenium remote webdriver and take the screenshot. Following is the code i used
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:9515"), capabilities);
driver.get("about:blank");
((JavascriptExecutor) driver)
.executeScript("arguments[0].innerHTML='" + StringEscapeUtils.escapeHtml3(_html) + "'");
The problem with this approach is, it is breaking the java script execution because of the new line character or some other characters and getting the below error
{"errorMessage":"Unexpected EOF","request":{"headers":{"Accept-Encoding":"gzip,deflate","Connection":
I got the log error message so i have pasted only certain portion of it.
I have looked into this in SO but it did not help me much.
Can you please help me to solve this? My question is i want to load the html string in selenium driver and take the screenshot.