I have jMeter test case already written, it has requests for logging in and some POST requests to my table. Now I want to measure render time of the page (response of the POSTS). I want to use Selenium so I read: Running Selenium scripts with JMeter
The problem is that i want Selenium to use the same session (in other words: to be already logged in) as logging in was handled by jMeter already. How can i archive that ?
My TestPlan:
[UPDATE] @Dmitri T
Thanks for answer! I did what you have suggested but it still don't work. Maybe I am doing something wrong but still just after Selenium opens browser it goes to login page. I put JSR223 PostProcessor under my LOGIN POST request and this is my WebDriver Sampler:
var pkg = JavaImporter(org.openqa.selenium);
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait);
var wait = new support_ui.WebDriverWait(WDS.browser, 5000);
WDS.sampleResult.sampleStart();
WDS.sampleResult.getLatency();
WDS.log.info("Sample started");
WDS.browser.get(WDS.parameters);
WDS.log.info("LOGGING INTO: " + (WDS.parameters))
var cookieManager = WDS.vars.getObject('cookieManager')
for (var i=0; i < cookieManager.getCookieCount(); i++) {
var jmeterCookie = cookieManager.getCookies().get(i)
var seleniumCookie = new org.openqa.selenium.Cookie(jmeterCookie.name, jmeterCookie.value, jmeterCookie.domain, jmeterCookie.path, java.util.Date.from(java. time.Instant.ofEpochMilli(jmeterCookie.expiresMillis)), jmeterCookie.secure)
WDS.browser.manage().addCookie(seleniumCookie)
}
java.lang.Thread.sleep(5000)
WDS.sampleResult.sampleEnd();
{UPDATE 2}
Ok, i think that htere is something wrong with Cookies in all Thread Group. I have [no cookies] on every request: