Response code 410 in jmeter - jmeter

I am trying to load-test a web application using JMeter. I used proxy and then run the test. I am able to login into the application, but for some pages it is giving response code 410 in J Meter.
I tried to ignore the error by adding Bean Shell Post Processor to the test script by writing the following code in it:
if (prev.getResponseCode().equals("410") == true) {
prev.setResponseOK(); }
However, the response in View Results tree is visible intermediately and the script is getting executed.
I need help to resolve the 410 error.

Add a Response Assertion and check "Ignore Status":

Related

jmeter dont foud the path while is woring in the browser

i can't get a path response in jmter (http://localhost:3000/X) the reponse message is "not found" with 404 cod,while the path (http://localhost:3000) is working with 200 code any one to help please
you can click to see the response of each path
http://localhost:3000
http://localhost:3000/X
So what?
If you open https://stackoverflow.com/ in JMeter or browser you will get HTTP Status Code 200
If you open https://stackoverflow.com/X in JMeter or browser you will get HTTP Status Code 404 because this URL doesn't have any candidate page.
If you expect the non-existent page to return HTTP status code 404 and don't want JMeter to mark this result as failed - add a Response Assertion as a child of this request and configure it like:

Network requests not showing up in cypress command log

We are trying to write a cypress test that checks one of the xhr requests made from the page. However the requests that we are making are not showing up in the command log. They do however show up in the bash console after running cypress open.
Command log:
Bash console:
We have tried running our simple test against other domains such as cypress.io, and google.com. Requests show up just fine.
We have verified that the requests made are not fetch requests.
We have disabled chomeWebSecurity (not sure if relevant).
Here is the example we are using:
describe('example', () => {
it('visits a page', () => {
cy.server();
cy.route('POST', '**');
cy.visit('https://www.academia.edu/12297791/Open_Access_Meets_Discoverability_Citations_to_Articles_Posted_to_Academia.edu');
});
});
Here is our cypress.json file:
{
"chromeWebSecurity": false
}
We are running cypress version 3.4.1
I would expect the command log to have these post requests show up, like this documentation describes: https://docs.cypress.io/guides/guides/network-requests.html#Requests
Any help is greatly appreciated, as we're unsure how else to debug this.
1.) I would suggest to use a more up-to-date version of Cypress with the cy.intercept().
2.) A typical problem can be the timing - add a cy.wait(X) before it, or add a timeout to replace the default timeout.
3.) Make sure the path of the route/intercept, especially when it differs from the cy.visit() 's url.
4.) Additional hint, use aliases.

JMeter HTML report - HTTP requests named <name>-0, <name>-1 <name>-2 etc - Why?

I have two thread groups in my project, and on of them has two HTTP request samplers. It's set up like the following
Thread group
Timer: Random between 1 and 5 minutes: ${__Random(60000,300000)}
HTTP request: A basic GET web service call
HTTP request: A basic GET web service call
Here's the Thread group setup.
That's it. Here's an example of the web service call setup
And here's what the "Statistics" portion of the HTML report looks like. Note the -1, -2 after the HTTP Request names. I'm trying to figure out why that's happening.
My other thread group / samplers are not displaying that way, but they're set up the same way, as far as I can tell.
In your example, HTTP requests Get Locations-0, Get Locations-1 are sub requests of Get Locations which appeared since you have selected the check box - Follow Redirects.
In case, you don't want HTTP requests Get Locations-0, Get Locations-1 to appear in your HTML report:
In the listener page(where you have saved the result file; which is the source file of HTML report) -> click on configure button -> uncheck the Save Sub Result option
You can also refer :Configure result file to customize HTML report
Turns out that some of the calls were returning a 200, others a 301, that's where they got separated out, even though the 301's didn't register as errors in the report.

Accessing API layer

I am trying to access an api function, for example I want to access the login function, I get the following error:
"message": "An internal error occurred during your request!",
Looking in the log file, the following log is there:
ERROR 2017-10-09 17:01:37,296 [11 ]
nHandling.AbpApiExceptionFilterAttribute - Processing of the HTTP
request resulted in an exception. Please see the HTTP response
returned by the 'Response' property of this exception for details.
System.Web.Http.HttpResponseException: Processing of the HTTP request
resulted in an exception. Please see the HTTP response returned by the
'Response' property of this exception for details.
I am using Postman to test. My URL is https://localhost:44347/api/Account/Authenticate. My header has Context-Type as "application/json" and in my Body I have the loginModel formatted as
{
"tenancyName": "tenantname",
"userNameOrEmailAddress": "admin",
"password": "123qwe"
}
Am not sure how else to proceed on this. Any ideas please? I have swagger installed as well.
I am using MVC + AngularJS template. I have not changed anything, just the default project.
Appreciate the assistance.
I have tested with Fiddler and it works correctly.
Note: make sure you type Content-Type correctly, on the question you typed Context-Type
Make a POST request! You may be missing this.

Grails Canoo Webtest plugin: invoke() fails to send JSON data in POST request

I'm evaluating Canoo Webtest for automated integration/functional testing as a Grails plugin.
I have a REST app which I'm attempting to test, but Canoo Webtest doesn't seem to properly send the JSON data in POST request. My test code is like below
invoke( description:"Add a product to shopping cart",
url:'shoppingCart/add', method:'POST',
content:'{"class":"shop.service.Product", "name":"A product", "description":"Manufactured by X", "price":99.9}'
//contentFile: '../product.json'
)
The request body is empty no matter whether I use contentFile approach or inline the data as content attribute. The test report shows the data as being sent correctly, but error page shows an error stating 'JSONException: Missing value. at character 0 of '. JSON data as a response of GET request is coming back fine.
I have tested the same functionality with curl and it works perfectly fine. Is there something I'm missing in the Canoo Webtest setup?
Thanks.
EDIT: I'm using Grails 1.3.7 in case that makes any difference
OK. I started to just experiment with the invoke() and seems that setting attribute soapAction value to true does the trick.
I have no clue why this works. The documentation of invoke() for the attribute says
soapAction
Required? no
If the HTTP method is POST and is in fact a SOAP POST request,
this allows the SOAP Action header to be set. Ignored for GETs.
Apparently it sets some needed request header. Haven't checked which one.
Thank you for reading :)
Cannot yet mark this answer as the correct one, but will do so when it's possible.

Resources