Skip to content

XLT: Server response could not be parsed #315

Closed Answered by wurzelkuchen
srcd4 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

It sounds as if you try to submit the form by one of the loadPageBy… methods. This will always expect a full HTML document since it’s the equivalent of a page load in the browser.
When you get a JSON response the form submission is probably done via an XMLHttpRequest/Ajax request (XHR) by the JavaScript of your site.
For such calls you’ll have to mimic this behavior by sending an HttpRequest with the same post and query parameters as well from your testsuite.
XLT brings the class com.xceptance.xlt.engine.httprequest.HttpRequest for such tasks.

        WebResponse response = new HttpRequest()
            .baseUrl("https://mypage.com")
            .relativeUrl("path/to/form/submit")
   …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@srcd4
Comment options

@wurzelkuchen
Comment options

Answer selected by rschwietzke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants