Class: JmeterPerf::Plugins::JsonPathExtractor

Inherits:
Object
  • Object
show all
Includes:
Helpers::XmlDocumentUpdater
Defined in:
lib/jmeter_perf/plugins/json_path_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ JsonPathExtractor

Returns a new instance of JsonPathExtractor.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jmeter_perf/plugins/json_path_extractor.rb', line 6

def initialize(params = {})
  @doc = Nokogiri::XML(
    JmeterPerf::Helpers::String.strip_heredoc(
      <<-EOF
        <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">
          <stringProp name="VAR"></stringProp>
          <stringProp name="JSONPATH"></stringProp>
        </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
      EOF
    )
  )
  update params
  update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



4
5
6
# File 'lib/jmeter_perf/plugins/json_path_extractor.rb', line 4

def doc
  @doc
end