I have created a test plan using Selenium/Webdriver in JMeter and trying to run the test plan using chrome driver in headless mode, unfortunately it didn't work. Please see the logs below for more information.
Logs:
2020-04-13 13:16:12,115 INFO c.g.j.p.w.s.WebDriverSampler: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/81.0.4044.92 Safari/537.36
2020-04-13 13:16:12,115 INFO c.g.j.p.w.s.WebDriverSampler: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/81.0.4044.92 Safari/537.36
2020-04-13 13:16:37,489 ERROR c.g.j.p.w.s.WebDriverSampler: element not interactable
(Session info: headless chrome=81.0.4044.92)
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'sltubuntu-VirtualBox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.3.0-46-generic', java.version: '11.0.6'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 81.0.4044.92, chrome: {chromedriverVersion: 81.0.4044.69 (6813546031a4b..., userDataDir: /tmp/.com.google.Chrome.uK8blq}, goog:chromeOptions: {debuggerAddress: localhost:42747}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(autodetect), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: dfadc0d335251bb92243425ea7163d06
2020-04-13 13:16:38,411 ERROR c.g.j.p.w.s.WebDriverSampler: element not interactable
Script:
WDS.sampleResult.sampleStart()
WDS.browser.get('https://lifec.com/');
var username = WDS.args[0];
var password = WDS.args[1];
var msisdn = WDS.args[2];
WDS.log.info('username : ' + username);
WDS.log.info('password : ' + password);
WDS.log.info('msisdn : ' + msisdn);
WDS.log.info(WDS.browser.executeScript('return window.navigator.userAgent'));
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@id='username']")).sendKeys(username);
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@id='password']")).sendKeys(password);
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@value='Login']")).click();
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[text() = 'Search']")).click();
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@id = 'cli']")).sendKeys(msisdn);
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@id='orderStatusId']/option[5]"));
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@value='Search']")).click();
WDS.browser.findElement(org.openqa.selenium.By.xpath("(//*[contains(text(),'Lead Generator')])[2]/following::*[6]")).click();
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[@href='#orderSummary']")).click();
WDS.browser.findElement(org.openqa.selenium.By.id("userDropdown")).click();
var verifyUsername = WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[contains(text()," + username + ")]"));
WDS.log.info('verifyUsername : ' + verifyUsername);
verifyUsername == username;
WDS.log.info('verifyUsername :: username -->' + verifyUsername + "==" + username);
WDS.browser.findElement(org.openqa.selenium.By.xpath("//*[contains(text(),'Logout')]")).click();
WDS.sampleResult.sampleEnd();