JavaScript code to stay on a browser page using JMeter Web driver sampler

I have written a Javascript code in JMeter Web driver sampler, which working fine for me. But my requirement is to open diffrent browsers using diffrent credentials & stay on a perticular page.

Below code executes correctly and closed the browser. How can I make the browsers remain open.

var pkg = JavaImporter(org.openqa.selenium);
var support_ui = JavaImporter(; 
var wait = new support_ui.WebDriverWait(WDS.browser, 5000);

WDS.sampleResult.getLatency();"Sample started");
var wait = new support_ui.WebDriverWait(WDS.browser, 5000);
var user = WDS.browser.findElement('userName'));
user.sendKeys(['']);"user1 entered");
var password=WDS.browser.findElement('Password'));
password.sendKeys(['0125602']);"password entered");
var btnlogin =WDS.browser.findElement('btnLogin'));;"button clicked ");

var livepage = WDS.browser.findElement(pkg.By.xpath('//*[@id="navbar-large- 
device"]/ul/li[2]/a/div'));;"Live page clicked");

1 answer