Hello,
Function select.options.remove works in IE 6, but does not work in FF 3.6 (at least), I don't know should
it works in HtmlUnit, but I have problem when I try to test pages where this function is.
For example:
<html>
<head></head>
<body>
<script language="javascript">
function deleteOption()
{
var sel = document.getElementsByTagName("select")[0];
sel.options.remove(0);
}
<select>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</body>
</html>
public void test() throws FailingHttpStatusCodeException, MalformedURLException, IOException
{
WebClient client = new WebClient(BrowserVersion.INTERNET_EXPLORER_6);
HtmlPage page = client.getPage("http://localhost:8080/test2.html");
}
EcmaError: lineNumber=[8] column=[0] lineSource=[<no source="">] name=[TypeError] sourceName=[script in http://localhost:8080/test2.html from (4, 31) to (11, 10)] message=[TypeError: Method "remove" called on incompatible object. (script in http://localhost:8080/test2.html from (4, 31) to (11, 10)#8)]
com.gargoylesoftware.htmlunit.ScriptException: TypeError: Method "remove" called on incompatible object. (script in http://localhost:8080/test2.html from (4, 31) to (11, 10)#8)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:499)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:474)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:880)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:312)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:379)
at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:225)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:245)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:578)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:536)
at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)
at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)
at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)
at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:765)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:211)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:165)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:225)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:108)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:429)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354)
Thank you.
Now fixed in SVN. Thanks for reporting.