I am exploring ways to automate the process of logging in multiple users with different credentials on a web page. My solution involves using JMeter with Selenium to achieve this automation. To read the usernames and passwords from a CSV file, I need to pass a JMeter variable in my code so that the process remains dynamic.
For instance:
findElement(By.name("username")).sendKeys(${username}) <- In this part of the code, I aim to pass a JMeter variable
WDS.sampleResult.sampleStart()
WDS.browser.get('https://www.google.com/')
WDS.browser.findElement(org.openqa.selenium.By.name("q")).
sendKeys(**${here I want to put JMeter variable}**)
WDS.sampleResult.sampleEnd()
Can you suggest the most effective approach for accomplishing this task?