Web API load testing - asp.net-web-api

When I record script, my login page recorded as html. but other pages not recorded as html pages rather it shows as js and web APIs. I cannot able to record or create script using html url. Kindly anyone help what exactly the solution. I can able to load test only web API or any way to create script using html urls.

It depends on your application nature. The whole idea of web applications load testing is simulating real users which are using real browsers as close as possible so ideally your load test should exactly mimic the HTTP Requests originating from browser when user is doing actions according to application use case(s).
You should not be recording .js files as well as .css files, all images and other media (audio, video, flash, whatever), instead of this you need to configure JMeter to download embedded resources instead of recording and replaying the relevant requests.
If you need to load test the API itself you can omit simulating browser and send requests directly to API endpoints, check out Building a WebService Test Plan JMeter User Manual chapter for more details.

Related

How Record WEB Application and test load/Performance in JMeter

I tried to test one WEB application. I log in to the application and then go to diff. menu. In JMeter, I used "HTTP(S) Test Script Recorder" to record the application after stopping the recording many requests are created and I tried to run those requests then some requests failed it shows error 403, "Invalid username and password ". Here I also used a recording controller.
So I need help to test the load /performance of my web application for multiple users so how is it achieved?
I don't think that "many" requests should be created, I can think of 3:
Open login page
Perform login
Go to "diff" menu
If you're seeing "many" requests most probably you're recording a lot of stuff that you should not be recording like embedded resources
There is Recording Template which is kind of handy, it has pre-defined patterns for excluding of common file types which you should not be recording
Also be aware that in the majority of cases you won't be able to successfully replay a set of recorded requests without correlating the dynamic parameters.

Is there any way we can modify Json data coming in the network tab of chrome and see the changes in the web page?

The webpage Template loads data via some json data we get from the endpoint.
I have a Rest Api and a Angular Front end . The Angular app populates the template from the data coming in from the rest api which we can see in the Network Tab of Chrome Developer Tools.
Is there any way we can modify the Rest data in Network tab and see the changes that occurs in the Webpage.
Is that even possible, It might sound a stupid question but i guess this might be a very special tool if there is not much interaction between the Back end and Front end teams.
I am not quite sure if i am able to explain it properly but this was the best i could edit please bear with me thanks
Just a Screen Shot of the type of data in Network tab.
Sample Data Network Tab
It is not possible from chrome's network tab. You have to use BurpSuite for example which is available in Kali linux as a default. With that you can intercept http requests and responses and modify it's payload.
You can get it from here: https://portswigger.net/burp/
No, you're not able to modify XHR data as you can other sources. What I do is just copy the file to my local drive and temporarily modify it's source. I test responses from API's using Postman and it's pretty awesome.
I have to say I'm a little bit afraid for you though. It's not a great idea to be consuming services from external api's from the client side. Are your API keys and passwords hanging out in that client side code somewhere?

How do I get XHR/Ajax resource timing data from window.performance?

When I open the Firefox "network" tab in the developer tools, I'm able to see the timing data from all the requests my page is making, including application/json (XHR) calls. I want to be able to get this timing information programmatically.
In Selenium, I let my page load fully and then ask the window.performance.getEntries() method for all of the resources. It gives me back a ton, including CSS, javascript, etc, but I don't see the calls to our RESTful services that show up in the Firefox window as "json" requests.
Since Firefox shows them in its Network tab in the developer tools, is a way for me to get them programatically? Our app is an angular app that is not using iframes.
I figured out my issue after a day of googling and trying different things. Thanks to this article I discovered that I needed to add Timing-Allow-Origin: * to the response header of all the services.
Once I did that, the timing information started to appear. It's apparently because the services are hosted at a different domain than my client. I don't understand the ramifications of leaving that header in there so I'll make sure it doesn't get deployed to production.

Performance tool for Web Single Page Application

Please, assist me on this one.
Project is for Web Single Page Application that does not provide different urls for different view. Everything loads by clicking within one screen. I was asked to find performance tool to test such application.
I will not be able to get HP Loadrunner or any such tool that is in the same price range. Maybe there is an open source or how to use JIRA for my project?
Thanks
When you click somewhere, even if screen doesn't change, browser sends relevant HTTP Request (usually GET or POST). JMeter acts on protocol level, it doesn't actually "render" the page or execute JavaScript but it can send any HTTP Request.
So you should be able to record all the requests using JMeter's HTTP(S) Test Script Recorder and replay them with larger number of threads according to your load test scenario.
You can use View Results Tree listener to visualize request and response details and JMeter Assertions to ensure that test actually does what it should do.

blacklist test requests from google analytics using watir

I have to automate tests for a web application which runs google analytics script. I have chosen watir for the automation since I can script all the test cases with the same. The only problem is i dont know how to remove my test requests to the web apps from the google analytics report. Can anyone help me with the same? Is it possible to do that with watir? If not watir, is there any other web automation tool which I could use?
~Thanks and Regarads
using your hosts file to send the google analytics requests to another server is probably a better way
disable JavaScript in the browser that Watir drives, that will not execute Google analytics code
you can filter out requests that Watir made, I am sure there is a way in Google analytics to filter out specific IP or something similar

Resources