0
votes

I am new to testing and using the jmeter for the first time. Using these steps I am trying to record the mobile device scripts in jmeter. I have done the following steps:

  1. Open JMeter and right-click the TestPlan>Add >Threads (Users)>Thread Group.
  2. Right-click the Thread group>Add>Logic Controller>Recording Controller.
  3. Right-click the Threads>Add>Listener>View Results Tree.
  4. Add test script recorder by selecting Add>Non-Test Elements>HTTP(S) Test Script Recorder option.
  5. Add ‘8080’ as Port value and click the Start button. This will start the JMeter proxy on localhost.

but when I am checking the server status on browsers (https://localhost:8080), following error comes:

org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: https://// at org.apache.http.impl.client.AbstractHttpClient.determineTarget(AbstractHttpClient.java:817) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:517) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:331) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146) at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:240)

1

1 Answers

0
votes

You shouldn't be opening https://localhost:8080 URL in browser, you need to configure your mobile device to use the machine, where JMeter is running as proxy host and 8080 as a proxy port.

If you want to test the HTTP(S) Test Script Recorder - configure you browser to use localhost as a proxy host and 8080 as a proxy port and open some intranet or Internet page - you should see the requests under the Recording Controller.

You quickly set up JMeter for recording using Templates feature, just choose File -> Templates -> Recording -> Create from JMeter's main menu and you will have JMeter ready for recording in a couple of seconds (default proxy port will be 8888 in this setup)

If you are targeting to record HTTPS traffic on a mobile device you will also need to install JMeter's self-signed certificate onto it. Look for ApacheJMeterTemporaryRootCA.crt file in JMeter's bin folder, send it to yourself via the email, open the email on mobile device and follow your mobile OS dialog to get it installed.

See Load Testing Mobile Apps Made Easy guide for more information on proper recording of mobile devices traffic using JMeter