selenium脚本无法运行

时间:2016-09-21 13:02:32

标签: java selenium

WebDriver driver;
      String baseUrl = "http://example.com";
    @BeforeClass  

  public void beforeClass() {
      System.setProperty("webdriver.firefox.marionette","local path to geckodriver-v0.10.0-win64");
      DesiredCapabilities capabilities = DesiredCapabilities.firefox();
      capabilities.setCapability("marionette", true);
      driver = new FirefoxDriver();
  }

  @Test
  public void login() throws InterruptedException {
      driver.get(baseUrl); 
      Thread.sleep(3000); 
  }

  @AfterClass
  public void afterClass() {
  }

这段代码我试图使用TestNG工具运行,但它失败了。

将它用作Java应用程序时运行完美但我想将此脚本作为TestNG脚本运行

0 个答案:

没有答案