Currently the Element class does not implement getAttributeNS and setAttributeNS for any of the browsers.
However at least FF3 does support these methods.
Currently we have to patch HtmlUnit to make our test work, it would be nice if these methods would be added to the Element class.
I'mm attaching a patch. The patch adds required methods to the com.gargoylesoftware.htmlunit.javascript.host.Element class and modifies the JavaScriptConfiguration.xml file accordingly.
Unit test?
Gladly, but I need some guidelines concerning what should the unit test cover. Usage of these two methods in a script? Something similar to
com.gargoylesoftware.htmlunit.javascript.host.ElementTest?
Doc for patches: http://htmlunit.sourceforge.net/submittingPatches.html
ElementTest is a good example to follow. Usage in a script is the best way as it is easy to check in real browser if expectations are correct or not.
Ok, I think I'll just extend the ElementTest, seems to be a right place.
Patch - including a test case.
I've just uploaded a new patch which includes a unit test as well.
I've made sure that all the tests go green.
BTW I've also added removeAttributeNS and hasAttributeNS methods.
Now fixed in SVN. Thanks for the patch.