Class: RubyJmeter::Plugins::JsonPathExtractor

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/ruby-jmeter/plugins/json_path_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#enabled, #enabled_disabled, #update, #update_at_xpath, #update_collection

Constructor Details

#initialize(params = {}) ⇒ JsonPathExtractor

Returns a new instance of JsonPathExtractor.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ruby-jmeter/plugins/json_path_extractor.rb', line 6

def initialize(params={})
  testname = params.kind_of?(Array) ? 'XpathExtractor' : (params[:name] || 'XpathExtractor')
  @doc = Nokogiri::XML("    <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass=\"com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui\" testclass=\"com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor\" testname=\"jp@gc - JSON Path Extractor\" enabled=\"true\">\n      <stringProp name=\"VAR\"></stringProp>\n      <stringProp name=\"JSONPATH\"></stringProp>\n    </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>\n  EOF\n  update params\n  update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]\nend\n".strip_heredoc)

Instance Attribute Details

#docObject

Returns the value of attribute doc.



4
5
6
# File 'lib/ruby-jmeter/plugins/json_path_extractor.rb', line 4

def doc
  @doc
end