1

firefox と chrome の 2 つのブラウザーで同時にテストを実行しようとしていました。次のコマンドで3つのコマンドラインウィンドウを開きました1. java -jar selenium-server-standalone-2.33.0.jar -role

  1. java -jar selenium-server-standalone-2.33.0.jar -role webdriver -hub localhost:4444/grid/register -browser browserName="chrome", version=8.0, platform=WINDOWS -Dwebdriver.chrome.driver=f: \chromedriver.exe

  2. java -jar selenium-server-standalone-2.33.0.jar -role webdriver -hub localhost:4444/grid/register -port 5566

GridTest.java ファイルに次のコードがありました

    public static String browser;
    public static void setUp() throws MalformedURLException //throws MalformedURLException
    {
//      if (browser.equalsIgnoreCase("firefox"))
//      {
        DesiredCapabilities capability1=DesiredCapabilities.firefox();
        capability1= DesiredCapabilities.firefox();
        capability1.setBrowserName("firefox");
        capability1.setPlatform(Platform.WIN8);
        driver=new RemoteWebDriver(new URL(nodeURL), capability1);
//      }
//      
//      if (browser.equalsIgnoreCase("chrome"))
//      {
        capability1=DesiredCapabilities.chrome();
        capability1.setBrowserName("chrome");
        capability1.setPlatform(Platform.WIN8);
        driver=new RemoteWebDriver(new URL(nodeURL), capability1);
//      }
    }

IE でテストを実行する必要がある場合、別のコマンド ライン ウィンドウを開く必要がありますか? テストは testng.xml と同時に実行できますか? 解決策を提供してください

4

2 に答える 2