Need to check if we can add different browsers in Jmeter? - jmeter

I need to check in Jmeter whether we can add different browsers to test. We have that option in loadrunner in runtimesettings to test with different browsers.
Thanks
Roshan

If you're talking about Browser Emulation - it's just sending the relevant User-Agent string
In JMeter you can achieve the same using HTTP Header Manager
The list of possible User-Agent header values can be found at i.e. http://useragentstring.com website

Related

How to record and create a JMX for an application only compatible in Microsoft Edge(Compatible mode IE5)

I have to do performance testing of an application only compatible in Microsoft Edge(Compatible mode IE5).Need to record the application and test in Jmeter.
Please help.
If you want to test the web application the main source for determining the client browser from its end is looking at User-Agent header.
So if you really need to mimic the 23-years-old-browser it's sufficient to send the relevant User-Agent using JMeter's HTTP Header Manager
Also you might be interested about the next funny fact: according to 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).
the same applicable to technologies like ActiveX or Flash or whatever else - you won't be simulate it in JMeter with 100% accuracy. The network footprint if any - yes, but no client-side impact.
The suggestion from Dmitri is valid.
You can set User-agent value to something relevant for the browser you want to simulate/fake.
Name = User-Agent
Value = Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.1; Trident/4.0)
In JMeter this is available in HTTP Header Manager. This component controls the headers for all of the requests you send.
Regarding the recording, I think it is better to use HTTP request samplers to simulate all the requests you want.

Load Testing in Struts2 Application - JMeter

I am trying to do a load test using JMeter for the first Time.
My approach is to test each page one by one.
The main page is like http://localhost:8180/myapp/login.do?actionType=login(I hardcoded the credentials)
I am able to reach this page without any problem.
I created a HTTP request component and able to see the response without any issue.
In the main page there is a button which populates the report, in the browser , the url is like
http://localhost:8180/myapp/mainmenu.do
But when i create a HTTP request it is reaching but shows the security error page in the 'Response
Data' as Due to security reasons, we still recommend you to close this window.
can someone guide me how to test the other pages without these security errors. This is a struts2 Web application.
No matter what technology is being used under the hood of the web application you're testing you should stick to one simple rule:
Well-behaved JMeter test must send exactly the same requests as real browser
It includes:
Same number/sequence/nature of the HTTP Requests
Same HTTP Headers (including Cookies)
any dynamic values need to be properly correlated
Once JMeter will send the same requests as real browser does it should receive the same responses. So just use a 3rd-party sniffer tool like Fiddler or Wireshark to capture the requests originating from browser and JMeter and amend JMeter's configuration until the requests start looking exactly the same. This should resolve your issue.
Solved the issue by adding HTTP Cookie Manger and
set Cookie Policy as Standard
click HTTP Cookie Manager
and click save icon on the top.
Source
https://jmeter.apache.org/usermanual/build-web-test-plan.html#adding_cookie_support
Thanks #Dimitri T and #Roman C for their valuable suggestion.

Jmeter recording feature capture different URL than what is provided in HTTPS domain

Whenever I try to use Jmeter recording functionality for the website, the requests send to website are captured but the name of website is different and body data is encrypted.
Jmeter always shows request for : ocsp.comodoca.com, ocsp.digicert.com, ocsp.pki.goog. But these are not the URLs provided for HTTPS Domains in Test Script Recorder.
I checked on the Internet that ocsp.comodoca.com, ocsp.digicert.com, ocsp.pki.goog provide SSL certificate. But why those are seen in Jmeter request are not known to me and how to see the URL for my test website? Thanks.
HTTPS Test Script recorder
Junk Request
I was also facing the same issue while recording with JMeter. I later found the issue had to do with the way I had setup the proxy options in Firefox.
I had forgotten to select the check box `Use this proxy server for all protocols. After selecting this check box, I was able to record my actual server URLs.
You're looking into wrong feature, the setting you should be using lives at Requests filtering tab of the HTTP(S) Test Script Recorder.
There is "URL Patterns to Exclude" input where you can filter out "not interesting" domains by providing a Perl-5-style regular expression, i.e. .*ocsp.*
See Excluding Domains from the Load Test article for more details if needed

Unable to get security token for Jmeter

I am trying to do some basic performance testing on an app I look after.
I am using Jmeter and done the steps recorder and the same as following Jmeter tutorials on youtube, but I am getting stuck when I need put the variable into the X-CSRF-Token
The issue is I cant find X-CSRF-Token in the captured steps. Is it using some other form of authentication? Any suggestions for me as to other methods would be great.
If the post doesn't make much sense, I don't really have an in-depth knowledge of Jmeter or testing.
To find where the token appeared:
clear browser history
record your scenario using jmeter recording template
then in the view result tree located un HTTP(s) Test Script recorder, use the search field to find the first response in which it appears. You’ll need to add an extractor in the corresponding sampler
you ‘ll then be able to inject it using ${varName}
Depending on your server configuration this X-CSRF-Token can come in:
In the response HTML body
In the response headers, inspect HTTP Header Manager for any hard-coded values
As a HTTP Cookie (which is basically a header as well, however it will be much more convenient to get it from the HTTP Cookie Manager rather than from response headers)
So make sure to inspect all the tabs of the first request in the View Results Tree listener as this X-CSRF-Token guy can hide anywhere.
You can try an alternative way of recording a JMeter test, it can export test in "SmartJMX" mode with automatic detection and correlation of any dynamic parameters including but not limited to CSRF tokens so theoretically it can make your life easier, check out How to Cut Your JMeter Scripting Time by 80% guide for more information and technical details.
If you need further help you will have to provide more details, like full dump of 2 requests along with responses. You can use a sniffer tool like Wireshark or Fiddler to capture it.

Capture WebDriver requests in Jmeter

One of the services I gonna test using Jmeter has complex authorization mechanism that requires some CS-based steps (JavaScript). So, to set up a session, I have to use WebDriver as Jmeter can't (and actually shouldn't) process JS.
I do it in the following way: at the beginning of each thread I open the resource in real browser (via Jmeter WebDriver plugin), complete authorization, store browser cookies that was set up by server and then use these cookies to generate load using standard Jmeter logic within defined HTTP-session.
This schema works fine and I successfully use it in different load tests.
But now the service I test requires not only cookies but also some important parameters that browser sends in POST as a part of authorization process. To prove that my requests belong to the same session, I should extract some sensitive parameters not from response (it can be easily done) but from request.
I can't find these values stored anywhere in DOM and it seems like these values are generated by JS attached to response page.
So, my question is: is there a way to capture parameters from request sent by WebDriver?
I understand that all requests done by browser initiated in Jmeter are not visible to it. And the only idea I see is to use Jmeter request recorder dynamically:
Open browser window.
Define Jmeter as a proxy for this browser.
Capture requests sent by browser in Jmeter using recorder.
Somehow extract sensitive data from requests.
Use the data to generate load.
Any ideas appreciated. Thanks in advance!
Solved the issue by running local proxy server (BrowserMob Proxy project) using BeanShell sampler. I retarget the WebDriver Sampler to this proxy, perform required actions using browser, then store captured data in HAR format and process it (extract required data from requests). Then just store valuable request parameters in variables (or properties) and use them in a regular way in HTTP sampler to generate load. Hope it can help anyone else in future.

Resources