// I had previously used a CSS/JQuery extractor to get a URL from a page and add it to JMeter vars - accessing it here
var pageURL = "${valueFromJmeterVars}";
// navigate to that url
WDS.browser.get(pageURL);
// selecting an element
var button = wait.until(pkg.ExpectedConditions.visibilityOfElementLocated(pkg.By.cssSelector(buttonLocator)));
// log desired boolean value to console, so I can confirm is as expected
WDS.log.info('reserveASpotButton:' + reserveASpotButton.isEnabled());
// add my boolean to JMeter vars, so I can access later from beanshell post-processor (where I do my assertions)
vars.put("reserveASpotButtonIsEnabled", reserveASpotButton.isEnabled());
上面的最后一行不起作用。
我可以成功地使用 CSS/JQuery Extractor 向 JMeter vars 添加值...
但是我怎样才能在 WebDriver Sampler 中做同样的事情呢?