I am trying to create script in JMeter for Registration page which contains 5 steps process and accepts unique Email ID.
Steps 1:
Asks for unique Email ID
Steps 2:
Contains some fields and "Email" entered in Steps 1 remains auto-filled
Step 3:
Contain some fields and "Email" entered in Steps 1 remains auto-filled
Step 4 and Steps 5
Some fields and "Submit" button
I have recorded a script and want 3 more users to get registered through unique Emails provided via CSV, however, Registration fails.
Error Screenshot:
https://www.cubbyusercontent.com/pli/REGISTER.png/_dd684965d46d45c68bccb2b7008d63c3
Do you have proper correlation logic in place? ASP.NET web applications use at lease VIEWSTATE page level state management mechanism which holds current state of things on client side and needs to be updated each subsequent request. It is usually looks like __VIEWSTATE hidden input, you need to extract it from previous response and add as a parameter to next request elsewise you'll be sitting on the very first page or receive server errors.
Take a look at ASP.NET Login Testing with JMeter post for example simulation of ASP.NET authentication flow. If it doesn't help - get ready to share you request/response details, we are not telepathic enough to tell what's wrong basing on the fact of HTTP 500 error.
Related
I have Zabbix server 5.0 and I should check an availability of Outlook authorization.
I'm trying to make a Web scenario with 2 steps:
Checking of the authorization page.
I use https://<domain_name>/owa but it is redirected to https://<domain_name>/owa/auth/logon.aspx?replaceCurrent=1&url=https%3a%2f%2f<domain_name>%2fowa%2f. I tick "Follow redirects" and get status code 200.
https://i.stack.imgur.com/Pzmhp.jpg
Trying of authorization.
I use the same URL that I was redirected to in the first step, also I input this in Raw Post
destination=https%3A%2F%2F<domain_name>%2Fowa&flags=4&forcedownlevel=0&username=&password=&isUtf8=1 (I can use Form Data too). But if I input an invalid password and username, status code in response is 200 too (screens are below). I think it's because of redirections: authorization is not done and I was redirected at the same page.
https://i.stack.imgur.com/wVAwa.jpg
https://i.stack.imgur.com/9ddgp.jpg
After this step is finished I get status code 200 always.
How to do it correctly?
Add a string check to the scenario you already created. Look for a string that is present only after a successful login.
Required regular expression pattern.
Unless retrieved content (HTML) matches the required pattern the step will fail. If empty, no check on required string is performed.
https://www.zabbix.com/documentation/4.2/manual/web_monitoring
I am using Workbox 3.6.1 now and I am really enjoy it.
But I just have a question about the post data caching of Workbox.
I may need to use the data which received from a request to post data to the server.
For example,
Step 1: the user enters his ID in the input field to validate his
identity and then to help the website rendering the rest content (eg: another input field)
Step 2: And the user enter some other information and sends the data
along with his ID to the server.
To my basic knowledge so far, I understand the Workbox can do the step 1 and 2 separately (I can only implement like this way......). But I just wondering if they will be queued together and when the website comes back online, the step 1 runs and the step 2 uses the data from step 1 and runs as well. During online, it can be done by using promises or callbacks. But i want to know if they are queued offline as well.
May be there is a way which I do not know, but I would like to know the official Workbox method to implement this case OR other workarounds.
Thanks for the help.
Suppose I have page 1, the user enters some option for selecting data.
The data is passed to page 2, it draws the chart with data from ajax request.
I just wonder what is the better practice to use values from page 1 in page 2. I can come up with 3 approaches
Store value in hidden field, the javascript uses the value of hidden fields for ajax
Embed server side script tag inside javascript for getting the request parameter, such as var data1 = <?php echo $_GET['data1']?>
Generate the javascript needed for page 2 in server side.
The best practice depends on your needs. Your methods work, and may be best for small, quick forms, but problems like load failures, timeouts, script errors and crashes could ruin the session. I would use a server-side database.
The advantage of temporarily storing the Page 1 information in a server database is that you could still have useful information (emails, addresses, etc.) if the user quits the session. This method will also let people pick up where they left off if they have to quit the session. With this method, you don't need to rely on volatile memory or insecure cookies to store information.
Submit form on Page 1 using POST.
Store all form variables in the server database with a unique session key.
Page 2 uses the unique session key to load the stored Page 1 variables in a query.
Submit page 2 including the unique session key.
Combine Page 1 and Page 2 data, permanently insert it into the database, then delete the temporary Page 1 record.
If the user doesn't submit Page 2, delete Page 1 information from the database regularly.
I am creating a dashboard application in which i show information about the servers. I have a Servlet called "poller.java" that will collect information from the servers and send it back to a client.jsp file. In the client.jsp , i make AJAX calls every 2 minutes to call the poller.java servlet in order to get information about the servers.
The client.jsp file shows information in the form of a table like
server1 info
server 2 info
Now, i want to add one more functionality. when the user clicks on the server1, I should show a separate page (call it server1.jsp) containing the time stamps in which the AJAX call was made by calling.jsp and the server information that was retrieved. This information is available in my calling.jsp page. But, how do i show it in the next page.
Initially, i thought of writing to a file and then retrieving it in my server1.jsp file. But, I dont think it is a good approach. I am sure i am missing a much simpler way to do this. Can someone help me ?
You should name your servlet Poller.java not poller.java. Classes should always start with an uppercase. You can implement your servlet to forward to a different page for example if sombody clicks to server1 then the servlet will forward to server1.jsp. Have a look at RequestDispatcher for this. Passing information between request's should be done by request attributes. if you need to retain the information over several request you could think about using session.
In the .NET world, we use SessionState to maintain data that must persist between requests. Surely there's something similar for JSP? (The session object, perhaps.)
If you can't use session state in a servelet, you're going to have to fall back on a physical backing store. I'd use a database, or a known standard file format (like XML). Avoid home-brew file formats that require you to write your own parser.
I am designing a RESTful API and am using the usual HTTP status codes like 200, 404, 500, etc.
Given the situation where occasionally the API will require additional data. When this event arises it needs to respond with a relevant status code so that the client application can present the relevant user interface.
Example:
User fills in form and hits submit (using AJAX)
Server sends response with some status code to indicate that further information is required which is accompanied with additional user interface.
Additional user interface is displayed
User resubmits form
I have this working with a 200 status code, but I would prefer to use a different status code so that my AJAX handler can detect and handle this scenario automatically.
Are there any relevant status codes or would I need to use a sub status code which is returned as a part of my JSON response?
I would go with a 400 Bad Request, since there is more data needed.
Alternatively, a 100 Continue could also work.
Either of those codes indicates that more info is needed.
how about 202 Accepted
"The request has been accepted for processing, but the processing has not been completed"
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
I would suggest 412 Precondition Failed.