Using JMeter with iframes - iframe

I have a test plan for our UAT environment using JMeter and part of the user journey involves hitting a page with an iframe to accept payment using a payment provider.
The payment provider from the iframe has three stages:
Select payment type (VISA, MasterCard etc.)
Enter payment details (Card number, expiry etc.)
Enter status code (Approved or Declined because it is a test environment)
How do I implement these iframe requests using JMeter?

You can try and record it first. Use either JMeter proxy: http://jmeter.apache.org/usermanual/component_reference.html#HTTP(S)_Test_Script_Recorder
Or BlazeMeter's Chrome extension: http://community.blazemeter.com/knowledgebase/articles/231479-chrome-extension
You will then need to clean an parametrize your script. Take a look at CSV data set config: http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
If you need some video tutorials to do just that, take a look here: http://blazemeter.com/blog/jmeter-tutorial-video-series

You're best bet is probably BlazeMeter's JMeter chrome extension, though you need to change one of the settings.
When you are browsing a site that uses iframes, AJAX calls, JS based requests (etc) you need to into the "Advanced Options" in the extension and uncheck "Record Only Top Level Requests".
The extension will now record EVERY request your browser is making, so be sure to close any other tabs you have open.
The Test Script Recorder might be failing due to security issues on the domain in the iframe. The advantage of using the chrome extension is that it doesn't care if the requests are secure or not.

Related

How to Perform Stress/Load test on a chrome extension using Jmeter?

The title explains it.
I have a chrome extension that I have been working on, which shows relevant dcouments and data from a DB related to the webpage open on the main tab. And now I have to stress test it by checking how many users can it handle at once after logging in and clicking on the search "All" documents.
I have been trying to find some good tutorials, but all i get is testing using different jmeter extensions for chrome.
If jmeter can't be used for stress testing an extension, can you share a better alternative for the task?
The title doesn't explain it.
How many users can use a chrome extension concurrently? Only one. Therefore Stress/Load test is not applicable, what you can do is to profile it.
If you want to add test automation on top of it, i.e. to measure how fast it opens, switches between screens/views, react on clicks, etc. you can consider using WebDriver Sampler (can be installed using JMeter Plugins Manager) but again it will be only simulation of 1 user.
Another story is load testing the backend, for example if chrome extension is connecting to some remote server and you need to check how does the server handle hundreds/thousands of the extension users. In this case most probably you will be able to use JMeter to simulate multiple concurrent users using the chrome extension by replicating their network footprint using appropriate JMeter Samplers, in case of HTTP protocol you can even record the requests using JMeter's HTTP(S) Test Script Recorder and replay it with increased number of users.

JMeter (CSS not apply in case of recording time )

I need a help, I try to record a script of some application like http://in.musafir.com/ ,https://www.makemytrip.com/ etc but after recording started page is open but CSS not apply in that case I am unable to create script due to fields missing or disturbance.
I am not excluding CSS and other in JMeter proxy server page.
One another thing some application getting connection exception after used ApacheJMeterTemporaryRootCA (its apply in the case show the message) .
This all testing is done in home environment & company environment. And both places has same issue.
Please update me the solution of this issues.
JMeter HTTPS script recorder gives you option to exclude certain URL requests based on their type. You can add or remove these URL patterns in your HTTPS Test Script Recorder.
JMeter recording template by default excludes css. So if you want to record CSS requests then simply remove css from this section. Check screenshot for details.
Regarding Root Certificate, if you are getting a message like below then it is normal and expected.
Please read JMeter Official documentation for more details about HTTP Test Script Recorder.

How to Automate Web Analytics testing?

Omniture/SiteCatalyst's code is integrated onto the webpage to collect the analytics in our firm.
Current process: SiteCatalyst id deployed by pasting HTML code onto each page of the website. This HTML code contains variables and other identifiers that facilitate the data collection process. These variables may be dynamically populated with server or application variables. The code snippet also calls the JavaScript library file, which contains SiteCatalyst-specific JavaScript functions used during metrics collection.
We use Add-on's like Charlie, HTTP Post, DigitalPulse Debugger to Test if the code inserted has accurate values corresponding to it. This process is time consuming and tedious.
How to Automate this process? Any help would be appreciated!
Example 1:
Click here to send a page view
s.pageName="New Page"
s.prop1="some value"
void(s.t());
Example 2:
s=s_gi('myreportsuiteid');
s.linkTrackVars="prop1,eVar1,events"; s.linkTrackEvents="event1";
s.prop1="some value"; s.eVar1="another value"; s.events="event1";
s.tl(this,'o','My Link Name');
There are a few different ways to automate testing. I've been looking into it lately myself. So far I'm looking into Selenium, Zombiejs and Phantomjs. You can search for "headless testing" which basically let's run code as a browser and test conditions on the page you visit.
Here's a good place to start https://github.com/ariya/phantomjs/wiki/Headless-Testing
Using these platforms, you could easily set pages to automatically validate if the SiteCatalyst code is firing, page names are correct, click events happen etc.
Selenium is an enterprise product whereas the JS frameworks would be more of a development effort.
we usually do this using a more customizable proxy application called Fiddler which we use to capture all the traffic sent from our brower.
Fiddler has an internal scripting language that let you make any type of check on the data passing in the Adobe Analytics call and highlight in the interface any bad call.

Scraping ASP.NET with Python and urllib2

I've been trying (unsuccessfully, I might add) to scrape a website created with the Microsoft stack (ASP.NET, C#, IIS) using Python and urllib/urllib2. I'm also using cookielib to manage cookies. After spending a long time profiling the website in Chrome and examining the headers, I've been unable to come up with a working solution to log in. Currently, in an attempt to get it to work at the most basic level, I've hard-coded the encoded URL string with all of the appropriate form data (even View State, etc..). I'm also passing valid headers.
The response that I'm currently receiving reads:
29|pageRedirect||/?aspxerrorpath=/default.aspx|
I'm not sure how to interpret the above. Also, I've looked pretty extensively at the client-side code used in processing the login fields.
Here's how it works: You enter your username/pass and hit a 'Login' button. Pressing the Enter key also simulates this button press. The input fields aren't in a form. Instead, there's a few onClick events on said Login button (most of which are just for aesthetics), but one in question handles validation. It does some rudimentary checks before sending it off to the server-side. Based on the web resources, it definitely appears to be using .NET AJAX.
When logging into this website normally, you request the domian as a POST with form-data of your username and password, among other things. Then, there is some sort of URL rewrite or redirect that takes you to a content page of url.com/twitter. When attempting to access url.com/twitter directly, it redirects you to the main page.
I should note that I've decided to leave the URL in question out. I'm not doing anything malicious, just automating a very monotonous check once every reasonable increment of time (I'm familiar with compassionate screen scraping). However, it would be trivial to associate my StackOverflow account with that account in the event that it didn't make the domain owners happy.
My question is: I've been able to successfully log in and automate services in the past, none of which were .NET-based. Is there anything different that I should be doing, or maybe something I'm leaving out?
For anyone else that might be in a similar predicament in the future:
I'd just like to note that I've had a lot of success with a Greasemonkey user script in Chrome to do all of my scraping and automation. I found it to be a lot easier than Python + urllib2 (at least for this particular case). The user scripts are written in 100% Javascript.
When scraping a web application, I use either:
1) WireShark ... or...
2) A logging proxy server (that logs headers as well as payload)
I then compare what the real application does (in this case, how your browser interacts with the site) with the scraper's logs. Working through the differences will bring you to a working solution.

Any suggestions for good automated web load testing tool?

What are some good automated tools for load testing (stress testing) web applications, that do not use record and replay of HTTP network packets?
I am aware that there are numerous load testing tools on the market that record and replay HTTP network packets. But these are unsuitable for my purpose, because of this:
The HTTP packet format changes very often in our application (e.g. when
we optimize an AJAX call). We do not want to adapt all test scripts just because
there is a slight change in HTTP packet format.
Our test team shall not need to know any internals about our application
to write their test scripts. A tool that replays HTTP packets, however, requires
the team to know the format of HTTP requests and responses, such that they
can adapt details of the replayed HTTP packets (e.g. user name).
The automated load testing tool I am looking for should be able to let the test team write "black box" test scripts such as:
Invoke web page at URL http://... .
First, enter XXX into text field XXX.
Then, press button XXX.
Wait until response has been received from web server.
Verify that text field XXX now contains the text XXX.
The tool should be able to simulate up to several 1000 users, and it should be compatible with web applications using ASP.NET and AJAX.
JMeter I've found to be pretty helpful, it also has a recording functionality to record use cases so you don't have to specify each GET/POST manually but rather "click" the use case once and then let JMeter repeat it.
http://jmeter.apache.org/
A license can be expensive for it (if you dont have MSDN), but Visual Studio 2010 Ultimate edition has a great set of load and stress testing tools that do what you describe. You can try it out for free for 90 days here.
TestMaker by PushToTest.com can run recorded scripts such as Selenium as well as many different languages like HTML, Java, Ruby, Groovy, .Net, VB, PHP, etc. It has a common reporting infrastructure and you can create load in your test lab or using cloud testing environments like EC2 for virtual test labs.
They provide free webinars on using open source testing tools on a monthly basis and there is one next Tuesday.
http://www.pushtotest.com
There are a few approaches; I've been in situations, however, where I've had to roll my own load generating utilities.
As far as your test script is concerned it involves:
sending a GET request to http://form entry page (only checking if a 200 response is given)
sending a POST request to http://form submit page with pre-generated key/value pairs for text XXX and performing a regexp check on the response
Unless your web page is complex AJAX there is no need to "simulate a button press" - this is taken care of by the POST request.
Given that your test consists of just a 2-step process there should be several automated load packages that could do this.
I've previously used httperf for load testing a large website: it can simulate a session consisting of several requests and can simulate a large number of users (i.e. sessions) simultaneously. For example, if your website generated a session cookie from the home page you could make that the first request, httperf would then use that cookie for subsequent requests, until it had finished doing the list of requests supplied.
What about http://watin.sourceforge.net/ ?

Resources