Read Browser's Network Tab to get Response from a certain API using Protractor - jasmine

I am using Protractor (Jasmine) for my Automated tests. The scenario I'm faced is to read the Response body from Browser's Network tab and extract certain data from the response body.
Any help available?

Related

Jmeter give error "We are sorry but vue-dms-ui-component doesn't work properly witouth Javascript enabled.Please enable it to continue"

In Jmeter, I have used "Recording with Think Time" for an application. Now when i run, in the Response I get message "We are sorry but vue-dms-ui-component doesn't work properly witouth Javascript enabled.Please enable it to continue".
I get this message for all the requests. I have enabled JavaScript in Firefox and then captured the recording.
Attaching the screenshot of the message.
enter image description here
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So it's not possible to "enable" JavaScript in JMeter.
If JavaScript is being executed on client-side only you can simply ignore this
If JavaScript generates a single network request - you need to mimic it using HTTP Request sampler
If JavaScript generates more than 1 network request at a time - use as many HTTP Request samplers as there are AJAX requests and put them under the Parallel Controller
Don't forget to perform correlation of dynamic parameters as in the vast majority of cases you cannot just replay the recorded network traffic.

Jmeter send requests that are not on my request list

I noticed this when analyzing wireshark. under thread group those requests are:
homepage/Account/Login
homepage/
homepage/LiveAlarm
and so on.
on wireshark there are some other requests that jmeter sends. but when i test this with browser, that requests wont be send.
after request 2)
HTTP GET /Content/css?v=........... HTTP/1.1\r\n
HTTP GET /Content/cus-css-plugins?v=......-..... HTTP/1.1\r\n
HTTP GET /images/logo/logo.._...png HTTP/1.1\r\n
and so on, totally 6 inintended requests are sent. there are not in the sampler list. and not sent when using browser.
the test script is recorded by blazemeter chrome plugin.
another unintended request
HTTP GET /signalr/hubs HTTP/1.1\r\n is sent by jmeter, but it is also sent when using browser.
because it is not in the sample list, the "Accept" field is very different between browser and jmeter. it is another issue. so, should i add this request to jmeter manually and control the fields?
BlazeMeter Chrome Extension generates a JMeter Test Plan with HTTP Request Defaults configuration element configured to "Retrieve Resources from HTML Files"
This is normal as it replicates real browser behaviour, real browsers download the HTML content from the response and then execute parallel HTTP Requests to download images, scripts, styles, fonts, sounds, etc. and this setting instructs JMeter to behave like a real browser when it comes to these embedded resources handling.
If you open your browser developer tools you should see the same requests (just tick "Disable cache" if you don't see them)
More information: Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses

Is it possible to pass Keys.TAB or Keys.Slash using Jmeter through groovy script?

Is it possible to pass Keys.TAB or Keys.Slash using Jmeter HTTP request through a groovy script?
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So if pressing tab or slash triggers a network request to your server - you can mimic it by sending the corresponding HTTP Request via HTTP Request sampler. You can check whether pressing a key generates network activity by looking at "Network" tab of your browser developer tools
If pressing a key doesn't generate a HTTP request - you won't be able to test this scenario using JMeter, you will need a real browser driven by the browser automation framework like Selenium. JMeter can be integrated with Selenium via WebDriver Sampler

Performance test on a webpage which loads data from multiple API's

We have a webpage which will load data from multiple api's as configured by the users. While doing performance test of this page, In HTTP request I have added this page URL and executed the script. To my surprise, the script executed successfully with status as 200 as I dig into more I changed the drop down(In View Results Tree) from Text to HTML(Download Resources) and I don't see any page data in the response. Can someone help me with this. I'm not sure how to proceed with performance testing on this particular page.
As per JMeter project main page:
JMeter is not a browser
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
My expectation is that your "multiple APIs" are triggered by JavaScript calls using AJAX technology. Given JMeter doesn't evaluate JavaScript it doesn't execute the AJAX requests which are being called by the real browser therefore you don't see the data coming from the APIs.
In order to get the browser-like behaviour you need to send the same requests which real browser sends, you can record them from the real browser using HTTP(S) Test Script Recorder or JMeter Chrome Extension
Also be aware that real browsers execute AJAX requests in parallel, in order to properly simulate browser's network footprint you need to place the HTTP Request samplers representing these API requests under the Parallel Controller

BlazeMeter Chrome extension not recording call to fill table

I am currently working on making a JMeter test for my company's website. I've been using the BlazeMeter Chrome extension to record http requests because I haven't been able to get the certificate working for the JMeter 2.11 proxy server.
On one of the site's main pages there is a large table that is filled by what I believe is an AJAX call. I use the extension to record using the page and add the recorded http requests to my test. However, when I run the test with those requests, none of the requests get responses that are anywhere near long enough to fill the table.
I made sure that the BlazeMeter extension is not just recording high-level requests, and that the cache is disabled. I know that the data is not sent with the initial html page because I can see that the table element is initially empty. Does the BlazeMeter extension not record every request? Or am I wrong to assume that the table is filled by and AJAX call? Or is there another protocol I'm missing entirely?
I'd start by analyzing the actual HTTP requests themselves. At the end of the day ANY performance tool you use to record browser activity is only going to record and playback the requests.
Is there an actual request that you can see your browser making that is not being recorded by the BlazeMeter chrome plugin?

Resources