Hi Marc,
see my comments below
Siegfried Goeschl
Marc Guillemot wrote:
Siegfried Goeschl <[EMAIL PROTECTED]> writes:
Hi folks,
after some tinkering and research here are my findings
+) AFAIK this is valid but limited XHTML but HTMLUnit did not accept
"application/vnd.wap.xhtml+xml" as HTML Page and reported an error
I guess that the error is not reported when the page is loaded but on the next
step, when you want to do something on it like clickLink that works only on
html content. Correct?
yes
+) since a very few things are really simpler when you are a developer
we added an optional HTTP Header enforcing the content type of the
result page to be "application/xhtml+xml" even it is XHTML for mobile
clients
...
don't you introduce an error in your system changing the content type header?
I wrote a few tests and it seems to work - "dirty remains while quick is
long forgotten". I'm currently doing a Proof of Concept to get some
continous integration up and running therefore I'm not too concerned
about the hack.
What about letting htmlunit know that it should parse this content like an
htmlpage, for instance with a small Groovy step before your normal test steps
like:
<groovy>
import com.gargoylesoftware.htmlunit.*
class MyPageCreator extends DefaultPageCreator
{
String determinePageType(contentType)
{
if ('application/vnd.wap.xhtml+xml' == contentType)
return 'html'
else
return super.determinePageType(contentType)
}
}
def webClient = step.context.webClient
webClient.pageCreator = new MyPageCreator()
</groovy>
Okay, I got the general idea - but wouldn't this belong to HTMLUnit?
Marc.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest