Hello,
We are using htmlunit to automate an Oracle ADF based web site.
We were using htlmunit 2.17 and looking to upgrade to 2.27.
In 2.17 we were able to automate the site successfully.
In 2.27 we are facing an issue where in the response received on click of link is not processed successfully.
In 2.17 the same error use to occur but the response received was processed succefully.
Can you please guide us on this ? We want to upgrade to more recent htmlunit version but are stuck this point.
What change in htmlunit would cause this issue where this error blocks the further processing of the response ?
How can we possibly resolve this ? Please suggest. Any help will be greatly appreciated.
The below javascript error occurs:
======= EXCEPTION START ========
EcmaError: lineNumber=[6] column=[0] lineSource=[<no source="">]</no> name=[ReferenceError] sourceName=[script in https://mysyniverse.syniverse.com/portal/faces/tabnavigation?_adf.ctrl-state=fmu992z8i_4&Adf-Rich-Message=true&unique=1538465393460&oracle.adf.view.rich.STREAM=r1:0:pt_region1:1:pt1:t1&javax.faces.ViewState=!19sht65gh9 from (6, 2310) to (6, 3847)] message=[ReferenceError: "AdfPage" is not defined. (script in https://mysyniverse.syniverse.com/portal/faces/tabnavigation?_adf.ctrl-state=fmu992z8i_4&Adf-Rich-Message=true&unique=1538465393460&oracle.adf.view.rich.STREAM=r1:0:pt_region1:1:pt1:t1&javax.faces.ViewState=!19sht65gh9 from (6, 2310) to (6, 3847)#6)]
com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "AdfPage" is not defined. (script in https://mysyniverse.syniverse.com/portal/faces/tabnavigation?_adf.ctrl-state=fmu992z8i_4&Adf-Rich-Message=true&unique=1538465393460&oracle.adf.view.rich.STREAM=r1:0:pt_region1:1:pt1:t1&javax.faces.ViewState=!19sht65gh9 from (6, 2310) to (6, 3847)#6)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:774)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:750)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:741)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript(HtmlPage.java:918)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:317)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:382)
at com.gargoylesoftware.htmlunit.html.HtmlScript$2.execute(HtmlScript.java:247)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:268)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:800)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756)
at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1236)
at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1136)
at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:226)
at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:345)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3178)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2141)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:945)
at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:521)
at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:472)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:999)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:250)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseXHtml(HTMLParser.java:206)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createXHtmlPage(DefaultPageCreator.java:284)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:169)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:522)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement$2.execute(BaseFrameElement.java:414)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:945)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:1015)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:988)
at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click(HtmlAnchor.java:84)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:929)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:869)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:850)
at syniverse227.Syniverse227.ClickOnLNP(Syniverse227.java:286)
at syniverse227.Syniverse227.main(Syniverse227.java:558)
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "AdfPage" is not defined. (script in https://mysyniverse.syniverse.com/portal/faces/tabnavigation?_adf.ctrl-state=fmu992z8i_4&Adf-Rich-Message=true&unique=1538465393460&oracle.adf.view.rich.STREAM=r1:0:pt_region1:1:pt1:t1&javax.faces.ViewState=!19sht65gh9 from (6, 2310) to (6, 3847)#6)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3915)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3899)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3976)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.name(ScriptRuntime.java:1821)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1634)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:765)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
... 43 more
Thank you
The current version is 2.33, please try the lastest one. Or do you have any reason to use 2.27?
Is there any public page to verify your problems?
Last edit: RBRi 2018-10-08
Hello RBRi,
Thanks for your reply.
We have tried using 2.33 also and are facing the same issue.
2.27 was preferred as we had started migration of other automation modules when 2.27 was the stable version available.
The site requires a userid/password . I will check if I can provide you the details. Is there a way I can provide the info to you directly ?
Thanks again.
My private email is available on the web page as part of the developer list
I'm running into what I believe is the same issue with an Oracle ADF site, using HtmlUnit 2.33. I was seeing the exception above, but it was actually masking the real problem, because I had the following in my code:
webClient.getOptions().setThrowExceptionOnScriptError(false);When I removed that, I instead received:
I've isolated it to the fact that there is a Javascript function call wrapped in a CDATA block. I've recreated it with the following dummy code:
(new Parser()).parse("<![CDATA[obj1.obj2.func1();]]>", "", 1);Sorry for the long silence here. Have done some fixes regarding the CDATA stuff. If you like, you can try with the latest snapshot build (will inform via twitter https://twitter.com/HtmlUnit if the related one is available)
The fix is now part of the 2.34.1 release. Will close this.