I have a problem and I stuck in it for two days, how can I add more than one argument constructor in “ Constructor String label” ?????
When I created my test in Junit , I create a constructor using two arguments, but in jmeter , a problem occurred and me telling that it’s impossible to create an instance because of the absence of one String Constructor. So, after that, I discover that jmeter only see one string constructor or an empty one
Please help me on this point or do you suggest another alternative to pass argument to Junit test in jmeter.
For more details, I want to automate IHM tests and at the same time measure the performance and the supporting numbers of users that connect at the same time. To do that, I create my test Case using Junit and Selenium, export the jar file into junit folder under apache jmeter, creating junit request and passing “${login}, ${password}” in Constructor String Label, and finally creating the Csv Data set config to bring login and password from txt file. But I faced the problem of “impossible to create an instance because of the absence of one String Constructor”. I try to use one String constructor with login , it works very well and bring me value form txt file, but with 2 arguments in constructor it doesn’t work because jmeter didn't support it. Do you suggest another alternative :s :s :s please Help.
This is the code i have so far:
public void test() throws InterruptedException {
driver.get(baseUrl + "/"); //clear username filed
driver.findElement(By.id("username")).clear(); //enter user name
driver.findElement(By.id("username")).sendKeys(login); //clear password
driver.findElement(By.id("password")).clear(); //enter password
driver.findElement(By.id("password")).sendKeys(password); //click on submit button
driver.findElement(By.id("submit")).click();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…