How to pass variable in Webdriver-Sampler | Jmeter Webdriver

前端 未结 1 1220
春和景丽
春和景丽 2021-01-25 02:20

I got a Testscript with more than 8 Webdriver-Sampler and a variable, which change in some of the Webdriver-Sampler.

For Example:

First Sampler:

相关标签:
1条回答
  • 2021-01-25 02:59

    You can access JMeterVariables class instance via JMeterContext.getVariables() method like:

    var vars = org.apache.jmeter.threads.JMeterContextService.getContext().getVariables()
    vars.put('foo','bar')
    var foo = vars.get('foo')
    //etc
    

    See The WebDriver Sampler: Your Top 10 Questions Answered guide for more WebDriver Sampler tips and tricks

    0 讨论(0)
提交回复
热议问题