How to open specific browser using selenium webdriver

后端 未结 5 536
遇见更好的自我
遇见更好的自我 2021-02-06 14:40

I am using lang :java framework: testNG

my system has 3-4 versions of Mozilla installed, how can i open instance of specific version of Mozilla. Suppose i have 3.5, 3.6,

5条回答
  •  时光说笑
    2021-02-06 14:50

    System.setProperty("webdriver.chrome.driver", "./chromedriver.exe");  //for chrome
    driver = new ChromeDriver();
    driver.manage().window().maximize();
    driver.get("WebsiteURL");
    
    
    System.setProperty("webdriver.gecko.driver", "./geckodriver.exe");  //for firefox
    driver=new FirefoxDriver();
    driver.manage().window().maximize();
    driver.get("WebsiteURL");
    

提交回复
热议问题