java - call a parameterized Junit test case from main method -


class containing test case

public class seleniumtestcaseparameterized  {  webdriver driver;  private string username, password, baseurl;  public seleniumtestcaseparameterized(string username, string password) {     this.username = username;     this.password = password; }      @before public void setup() { }    @test public void testseleniumtestcaseparameterized() throws exception {     driver.get(baseurl + "url");     driver.findelement(by.id("username")).sendkeys(username);     driver.findelement(by.id("password")).sendkeys(password);  }  @after public void teardown() {     driver.quit(); } 

class test case called in main method

public class mainclass {  public static void main(string[] args) {     string name =joptionpane.showinputdialog("please enter username");     seleniumtestcaseparameterized c = new seleniumtestcaseparameterized(name,name);     junit.textui.testrunner.run(c.getclass());      } 

i unable pass parameters test case main.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -