Module: RubyJmeter::Helper

Included in:
AccessLogSampler, AggregateGraph, AggregateReport, Ajp13Sampler, AssertionResults, BeanshellAssertion, BeanshellListener, BeanshellPostprocessor, BeanshellPreprocessor, BeanshellSampler, BeanshellTimer, BsfAssertion, BsfListener, BsfPostprocessor, BsfPreprocessor, BsfSampler, BsfTimer, CompareAssertion, ComparisonAssertionVisualizer, ConstantThroughputTimer, ConstantTimer, Counter, CssjqueryExtractor, CsvDataSetConfig, DebugPostprocessor, DebugSampler, DistributionGraphalpha, DurationAssertion, ForeachController, FtpRequest, FtpRequestDefaults, GCConsoleStatusLogger, GCDummySampler, GCLatenciesOverTime, GCResponseCodesPerSecond, GCResponseTimesDistribution, GCResponseTimesOverTime, GCResponseTimesPercentiles, GCThroughputShapingTimer, GCTransactionsPerSecond, GaussianRandomTimer, GenerateSummaryResults, GraphResults, HtmlAssertion, HtmlLinkParser, HtmlParameterMask, HttpAuthorizationManager, HttpCacheManager, HttpCookieManager, HttpHeaderManager, HttpRequest, HttpRequestDefaults, HttpUrlRewritingModifier, IfController, IncludeController, JavaRequest, JavaRequestDefaults, JdbcConnectionConfiguration, JdbcPostprocessor, JdbcPreprocessor, JdbcRequest, JmsPointtopoint, JmsPublisher, JmsSubscriber, Jsr223Assertion, Jsr223Listener, Jsr223Postprocessor, Jsr223Preprocessor, Jsr223Sampler, Jsr223Timer, JunitRequest, KeystoreConfiguration, LdapExtendedRequest, LdapExtendedRequestDefaults, LdapRequest, LdapRequestDefaults, LoginConfigElement, LoopController, MailReaderSampler, MailerVisualizer, Md5hexAssertion, ModuleController, MonitorResults, OnceOnlyController, OsProcessSampler, PoissonRandomTimer, RandomController, RandomOrderController, RandomVariable, RecordingController, RegexUserParameters, RegularExpressionExtractor, ResponseAssertion, ResponseTimeGraph, ResultStatusActionHandler, RuntimeController, SaveResponsesToAFile, SimpleConfigElement, SimpleController, SimpleDataWriter, SmimeAssertion, SmtpSampler, SoapxmlrpcRequest, SplineVisualizer, SummaryReport, SwitchController, SynchronizingTimer, TcpSampler, TcpSamplerConfig, TestAction, TestPlan, ThreadGroup, ThroughputController, TransactionController, UniformRandomTimer, UserDefinedVariables, UserParameters, ViewResultsInTable, ViewResultsTree, WhileController, XmlAssertion, XmlSchemaAssertion, XpathAssertion, XpathExtractor
Defined in:
lib/ruby-jmeter/helpers/helper.rb

Instance Method Summary collapse

Instance Method Details

#enabled(params) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/ruby-jmeter/helpers/helper.rb', line 32

def enabled(params)
  #default to true unless explicitly set to false
  if params.has_key?(:enabled) && params[:enabled] == false
    'false'
  else
    'true'
  end
end

#update(params) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/ruby-jmeter/helpers/helper.rb', line 18

def update(params)
  params.delete(:name)
  params.each do |name, value|
    node = @doc.children.xpath("//*[contains(@name,\"#{name.to_s}\")]")
    node.first.content = value unless node.empty?
  end
end

#update_at_xpath(params) ⇒ Object



26
27
28
29
30
# File 'lib/ruby-jmeter/helpers/helper.rb', line 26

def update_at_xpath(params)
  params[:update_at_xpath].each do |fragment|
    @doc.at_xpath(fragment[:xpath]) << fragment[:value]
  end
end