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?
> +) 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?
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>
Marc.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest