Invalid postback or callback argument error in JMETER - performance

I recorded a .net application using JMETER. After correlating and playing back it throws the below error. I have seen few posts which says eventvalidation has to be set false. Is there any other way to get rid of this error in Jmeter?
505|error|500|Invalid postback or callback argument.
Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%# Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.
If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I guess that you're either missing or passing incorrect ASP.NET Viewstate
Basically it's an input of "hidden" type which is required to store application state and some service data which you application is expecting.
My understanding is that you're either using kind of hard-coded or recorded viewstate value or totally missing it.
I recommend to append Regular Expression Extractor Post Processor (or any suitable kind of post-processors line Beanshell, BSF, XPath - if your application talks XHTML) to extract viewstate value from each request, store it in a variable and add it to every next request.

You need to disable event validation in the config

If the dynamic DropDownList in your page, you can try to set blank to the value of DropDownList in JMeter post data. I think this problem can be solved.

Related

Jmeter EVENTVALIDATION and VIEWSTATE values passed incorrectly

I need to login a webpage. Passing the parameters from navigation screen,to POST to login screen i used CSS/Jquery extractor. of the three values extracted, Viewstate generator value is passed correctly. But Eventvalidation and Viewstate has completely different values when passed.
Values i get from Navigating to the website:
`VIEWSTATEGENERATORExtractor=C2EE9ACC,VIEWSTATEExtractor=r6PHK0,
EVENTVALIDATIONExtractor=xLhYcNpU3vb8+Om5`
And passed as VIEWSTATEGENERATOR =C2EE9ACC
EVENTVALIDATION value=Blncm,VIEWSTATE" value=iFpefxx7
Some values are generated when passed through but not from previous browser navigation.
DO not understand how 1 value can be passed correctly and not other two. I use same format for all the three
This is the whole point of viewstate and eventvalidation parameters, they are different each time, that's why you need to correlate them for each request.VIEWSTATE has all the information about client-side page state, basically what did the user do on each step. EVENTVALIDATION is a form of CSRF protection, so it has to be different each time as well.
You can validate that your script is doing what it is supposed to be doing using View Results Tree listener.
References:
Page.EnableEventValidation Property
ASP.NET View State Overview
ASP.NET Login Testing with JMeter

Is Jmeter allow to select the option/value from the dropdown list

In My application which I am testing there is a drop down and I have to select the option/value from the list, After selection the value there is a text field which get auto populated. So can we do the same in Jmeter.
Please share the experience if any body has done.
Thanks in advance!
This will be quite difficult.
Selecting the value from the dropdown list is easy. But then your application probably makes an AJAX request to the server to populate the other values. So you would have to :
set up a separate HTTP Request which simulates your AJAX request
parse the HTTP response for the variables you need
save them into jMeter variables
use those to populate your next page request (the form submit)
A much easier way is to use some test data which you already know, and just submit your form with those fields hardcoded into jMeter.

Client side to server side calls

I want to change the list of available values in a dropdown depending on the value selected in another dropdown and depending on values of certain fields in the model. I want to use JQuery to do this. The only hard part is checking the values in the model. I have been informed that I can do this using Ajax. Does anyone have any idea how I will approach doing this?
AJAX is indeed the technology your looking for. It is used to sent an asynchronous request from the client browser to the server.
jQuery has an ajax function that you can use to start such a request. In your controller you can have a regular method tagged with the [HttpPostAttribute] to respond to your AJAX request.
Most of the time you will return a JSON result from your Controller to your view. Think of JSON as something similar to XML but easier to work with from a browser. The browser will receive the JSON and can then parse the results to do something like showing a message or replacing some HTML in the browser.
Here you can find a nice example of how to use it all together.

rememberMe occurs randomly without fiddler

ASP.net MVC 3 out of the box forms authentication
when certain users on certain browsers try and authenticate they get the following error
Server Error in '/MVC' Application.
--------------------------------------------------------------------------------
The parameters dictionary contains a null entry for parameter 'rememberMe' of
non-nullable type 'System.Boolean' for method 'System.Web.Mvc.ActionResult
LogOn(System.String,
System.String, Boolean, System.String)' in 'RipsMVC.Controllers.AccountController'. An
optional parameter must be a reference type, a nullable type, or be declared as an
optional parameter.
Parameter name: parameters
the problem is its not all the time but whenever i turn on fiddler2 it automatically works so i have no clue what the root cause is .
I don't think it related to fiddler, maybe you need to make rememberMe with [DefaultValue(false)] or make it a bool?.
Anyway, you can setup a breakpoint and check the request body (using Request.Forms) to see the difference with/without fiddler.
Is remember me a checkbox on the form? HTML says that checkbox values are only submitted if they are checked. So if it is unchecked, you need to send a hidden field with a false value. Using MVC #Html.CheckBox should do this automatically. However, if your HTML just renders out a single checkbox, then it might not be submitted to get a false value on the server.

ajax send parameter to jsp but failed

I am trying to send data to my jsp via:"xhr.send(projectCode);"
but apparently the parameter is not received when I am trying to realise it with System.out.print it is a null displayed.
so the story from the begining. my javascript function send the parameter to the jsp whitch construct an xml file and resend to the first one.
this will reconstruct my second dropdownList with the xml code constructed and received.
so the problem that the parameter dosent sent at all.
What should I do.
Just note in case the syntax whatever you have sent is like this:
url="postjob2.jsp?param=" + param;
After param=" keep a space and then the parameter. My issue got resolved as soon as I entered the space.
The simplest all-round solution is to run your application with a HTTP-tracer, such as fiddler for windows or wireshark. In that way you can see if the proper data is being submitted from your client to the server Given the amount of details you provide, I think this is the best starting point

Resources