How to exclude/include google maps in jmeter script?

1.7k views Asked by At

Query1: I am load testing an application which uses Google maps. While recording a script on Jmeter, Google map window is displayed as plain and map is not displayed. How to include google maps while recording script in Jmeter?

Query 2: I have tried to include/exclude the pattern ...(bmp|css|js|gif|ico|jpe?g|png|swf|woff). while script recording, but still google maps are not recorded and application gives error as "Map might have behaved wrongly."

2

There are 2 answers

1
AA Ron On BEST ANSWER

In some cases JMeter's built in recording controller will miss web transactions. It is recommended to use a professional web debugger separate from JMeter such as Charles or Fiddler. Then use those traces to carefully build a JMeter test plan. You could also check out BadBoy, which has some "export to jmeter" features.

When you replay those HTTP requests in JMeter, you will not see the "correct" page in View Results Tree. This is because JMeter cannot associate JS to a previous HTML response and execute the scripts needed to actually make the feature function, in this case Google Map code.

The important thing, from the load testing perspective, is to make sure JMeter is receiving all of the resources needed by the browser (accurately captured with a real web proxy tool). By the time you begin load testing an application the functional testing should be complete. This means there is no need to actually have JMeter run the maps code, just pull it from the servers at load.

In terms of the include/exclude on the recorder, you will find the professional tools are much more accurate.

I hope that somewhat answers the question, feel free to ask for more clarification. In general I find using JMeter's built in recording controller creates messy JMX files that require more refactoring work than the effort needed to carefully build a test from scratch using external traces.

2
Dmitri T On

It might be not the answer you're looking for, however testing Google Maps it not something you should be doing. I believe that you should focus solely on your application load testing and exclude any external stuff like Maps, Analytics, banners, etc. as Google Maps is not something you can control.

Hence I would recommend to limit your load testing only to your application domain and filter out Google Maps stuff

  • If you use separate requests for Google Maps queries - disable or delete them
  • If you retrieve Google Maps content via "Retrieve all embedded resources" - you can filter google domain related content by placing ^((?!google).)*$ regular expression into "URLs must match" input.

See Excluding Domains from the Load Test guide for more detailed information and instruction on how to exclude several domains.