Closed AdityaRawatNagarro closed 1 year ago
latest version?
Yes latest version
ok, looks like the javascript json parser has some trouble with a json (response).
Any chance to get the json? Can you please check if the same error is shown in the real browser console if open the same page?
file:/C:/Users/SHASHA~1/AppData/Local/Temp/168983780880998112312567390012.html this file is a temp file so i am not able to access it, No does not show the same error in real browser console. Even if i use chromebrowser instead of html unit it is working
let me think about it
Maybe you can use a web proxy like Charles (https://www.charlesproxy.com/) or Fiddler to capture the traffic. Had a quick look at the source - i fear i really need the json string.
@AdityaRawatNagarro any news?
The html file is the pagesource file of a webpage, it was causing this issue
@AdityaRawatNagarro thanks for the feedback - have fun using the HtmlUnit driver
Hi,
I am facing this issue while performing driver.findelement
Version:
Selenium version is also same
Caused by: org.htmlunit.ScriptException: SyntaxError: Empty JSON string (script in file:/C:/Users/SHASHA~1/AppData/Local/Temp/168983780880998112312567390012.html from (52, 9) to (328, 10)#312) at org.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:987) at org.htmlunit.corejs.javascript.Context.call(Context.java:590) at org.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:484) at org.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:348) at org.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:865) at org.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:841) at org.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:832) at org.htmlunit.html.HtmlPage.executeJavaScript(HtmlPage.java:964) at org.htmlunit.html.ScriptElementSupport.executeInlineScriptIfNeeded(ScriptElementSupport.java:378) at org.htmlunit.html.ScriptElementSupport.executeScriptIfNeeded(ScriptElementSupport.java:228) at org.htmlunit.html.ScriptElementSupport$1.execute(ScriptElementSupport.java:118) at org.htmlunit.html.ScriptElementSupport.onAllChildrenAddedToPage(ScriptElementSupport.java:141) at org.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:191) at org.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:598) at org.htmlunit.cyberneko.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:412) at org.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:547) at org.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1287) at org.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1214) at org.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:204) at org.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:274) at org.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2969) at org.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1953) at org.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:834) at org.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:346) at org.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:297) at org.htmlunit.cyberneko.xerces.parsers.XMLParser.parse(XMLParser.java:76) at org.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.parse(HtmlUnitNekoDOMBuilder.java:835) at org.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser.parse(HtmlUnitNekoHtmlParser.java:202) at org.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:301) at org.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:220) at org.htmlunit.WebClient.loadWebResponseInto(WebClient.java:664) at org.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at org.htmlunit.WebClient.getPage(WebClient.java:484) at org.htmlunit.WebClient.getPage(WebClient.java:391) at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:646) ... 5 more