You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "glinius@live.com" <gl...@live.com> on 2019/06/07 10:58:04 UTC
Re: Access to local storage data.
As per JMeter project main page <http://jmeter.apache.org/> :
> JMeter is not a browser, it works at protocol level. As far as
> web-services and remote services are concerned, JMeter looks like a
> browser (or rather, multiple browsers); however JMeter does not perform
> all the actions supported by browsers. In particular, JMeter does not
> execute the Javascript found in HTML pages. Nor does it render the HTML
> pages as a browser does (it's possible to view the response as HTML etc.,
> but the timings are not included in any samples, and only one sample in
> one thread is ever displayed at a time).
So if you have the value somewhere in browser session - just extract it
using browser developer tools
<https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools>
and add to JMeter script.
If you're working on JMeter integration with Selenium
<https://www.seleniumhq.org/> via WebDriver Sampler
<https://www.blazemeter.com/blog/jmeter-webdriver-sampler> - be aware that
you can manupulate window.localStorage object
<https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage>
using JavaScript like:
> //set value:
> WDS.browser.executeScript("localStorage.setItem('foo', 'bar')")
> //get value:
> var foo = WDS.browser.executeScript("return localStorage.getItem('foo');")
<http://www.jmeter-archive.org/file/t340375/foo.png>
--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org