Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlUnit: Unable to find element #211

Open
danielkp1234 opened this issue Aug 13, 2020 · 4 comments
Open

HtmlUnit: Unable to find element #211

danielkp1234 opened this issue Aug 13, 2020 · 4 comments

Comments

@danielkp1234
Copy link

danielkp1234 commented Aug 13, 2020

SeleniumHQ/htmlunit-driver/issues/91

@twendelmuth
Copy link
Contributor

Test Case to cause the (first?) issue:

    @Test
    @Alerts("openendedParams0")
    public void function_openEndedParams() throws Exception {
        final String html
            = "<html><head><title>foo</title><script>\n"
            + "function test(...t) {\n"
            + "  alert('openendedParams' + t.length);\n"
            + "}\n"
            + "</script></head><body onload='test()'>\n"
            + "</body></html>";

        
        loadPageWithAlerts2(html);
    }

Tested in latest master branch

Caused by: com.gargoylesoftware.htmlunit.ScriptException: missing formal parameter (script in http://localhost:22222/ from (1, 39) to (5, 10)#2)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:937)
	at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:619)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:537)
	at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:354)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:768)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:734)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:780)
	at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript(HtmlPage.java:943)
	at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:305)
	at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:395)
	at com.gargoylesoftware.htmlunit.html.HtmlScript$2.execute(HtmlScript.java:234)
	at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:256)
	at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:562)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:514)
	at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1195)
	at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1135)
	at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:219)
	at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:312)
	at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3189)
	at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2114)
	at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:937)
	at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:443)
	at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:394)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.parse(HtmlUnitNekoDOMBuilder.java:762)
	at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser.parse(HtmlUnitNekoHtmlParser.java:208)
	at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:283)
	at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:163)
	at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:641)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:368)
	at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:720)
	... 5 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: missing formal parameter (script in http://localhost:22222/ from (1, 39) to (5, 10)#2)
	at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$HtmlUnitErrorReporter.error(HtmlUnitContextFactory.java:438)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:258)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:326)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:320)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.mustMatchToken(Parser.java:480)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.mustMatchToken(Parser.java:470)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.parseFunctionParams(Parser.java:825)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:936)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:869)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:630)
	at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:570)
	at net.sourceforge.htmlunit.corejs.javascript.Context.parse(Context.java:2598)
	at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2547)
	at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1551)
	at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:224)
	at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1540)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$1.doRun(JavaScriptEngine.java:759)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:922)
	... 37 more

@twendelmuth
Copy link
Contributor

@rbri I guess that's the same problem as with #158 ? :)

@rbri
Copy link
Member

rbri commented Aug 21, 2020

Again something within Rhino

@danielkp1234
Copy link
Author

@rbri Any Update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants