From: <mbr...@vi...> - 2004-03-23 16:30:52
|
After some research I believe the Validation controls are IE specific and are supposed to be disabled when using any other browser (typical Microsoft tactic). I tested this with Netscape 7.1 and found that yes indeed the validation controls are disabled. So my current thoery is that ASP.NET thinks that HtmlUnit is an IE compliant browser. I remember there being a way of configuring the browser identity of HtmlUnit. Perhaps that will fix the problem. Mike Bresnahan Quoting Brad Clarke <bc...@bo...>: > At 10:29 AM 3/22/2004, mbr...@vi... wrote: > >Hello again. I have been away from the HtmlUnit seen for some months now. > I > >am now back at writing a test suite for a ASP.NET application. Things have > >changed since I last used HtmlUnit. I downloaded the latest sources from > CVS > >and found that much of my old code doesn't compile anymore. In > >particular, the > >method HtmlPage.getOneHtmlElementByAttribute() is gone. What is it's > >replacement? > > Some of HtmlPage's functionality was moved due to some DOM changes (I don't > understand most of it myself). If you can't find something that used to be > on HtmlPage look under HtmlPage.getDocumentElement(). Your method is: > > > HtmlPage.getDocumentElement().getOneHtmlElementByAttribute(...) > > >I see some classes with "xpath" in their name. Does HtmlUnit now > >have xpath support? I'm sorry if this is a FAQ, but I didn't find > >anything in > >the list archive. > > Yes it does. Here's an example (for you and the archive :p): > > final HtmlUnitXPath xpath = new > HtmlUnitXPath(xpathExpression); > HtmlElement element = (HtmlElement) > xpath.selectSingleNode(currentHtmlPage); > > >I also found that I had to download maven and add the following jars to the > >classpath to get the source to compile using JBuilder. > >... > > I never did...all the jelly stuff just fails for me. One of these days I > might add it to the ant build.xml, but I think I'd rather see good maven > support in Eclipse :) > > >One last thing, which is also an issue with 1.2.3, is that > >HtmlImageInput.click > >() does not cause the enclosing form to get posted. I had to call > >HtmlImageInput.click(0,0). Is this by design? > > The code looks like it will submit either way now. Try the nightly build > and log a bug if it doesn't. > > >I have not had time to create a nice test case, but I have found that in > >general HtmlUnit cannot deal with ASP.NET Validators (e.g. > >System.Web.UI.WebControls.CompareValidator). HtmlUnit blows up in the > >JavaScript produced by ASP.NET. > > Try the nightly build first, but if that doesn't help can you provide more > information about the javascript? I don't have an ASP.NET project to play > with. > > Brad C |