Maddyjak
Maddyjak

Reputation: 13

How can I set-up proxy while using ruby-jmeter test?

I've recently started looking into using ruby-jmeter gem for extending our Ruby/Cucumber Test Framework for Performance testing REST APIs in addition to functional testing.

I'm able to successfully execute a jmeter test from ruby, but the tests fail due to proxy not being set. How can I add the proxy setting for my test?

Here is the testplan I've created:

require 'rubygems'
require 'ruby-jmeter'

test do
  with_json
  threads count: 10 do
  get name: 'get_products_index', url: 'http://example- 
                           rest-api.herokuapp.com/api/products'
  end
  end.run(
      path: 'C:\\Users\\xxxxxx\\apache-jmeter-2.13\\bin\\',
      file: 'jmeter.jmx',
      log: 'jmeter.log',
      jtl: 'results.jtl'
  )

Here is the error I get -

1446567468415|21181|get_products_index|Non HTTP response code: 
org.apache.http.conn.HttpHostConnectException|ThreadGroup 
1-1|false|2373|10|10|0|1|1|null

Upvotes: 0

Views: 227

Answers (1)

sjethvani
sjethvani

Reputation: 530

@Maddyjak

For debugging actual errror , try to create jmeter file first & load it in to Jmeter UI . Execute test after adding 'Tree Results' listener for debugging purpose. for creating .jmx file in ruby-jmeter

 end.jmx(file: Dir.pwd+"/TestPlan.jmx")  # Dir.pwd will give your current directory path

There you will be having some more idea regarding error in jmeter logs as well under 'TreeListener'

Upvotes: 0

Related Questions