无法调用构造函数

时间:2017-12-19 17:25:18

标签: java selenium-webdriver fitnesse fitnesse-slim selenium-fitnesse-bridge

我收到错误Could not invoke constructor。我所有的课程都是正确的。 Division Fixture实际上曾经用过但现在已经破裂了。我从来没有让我的Selenium FitNesse工作。 任何想法?

维基: enter image description here

代码:

package fitnesseconcept.fitNesse;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import fit.ColumnFixture;
import junit.framework.Assert;

public class MySeleniumFitNesse extends ColumnFixture {

private WebDriver driver = null;
private String URL = "www.google.com";

public MySeleniumFitNesse() {
    System.setProperty("webdriver.chrome.driver",
            System.getProperty("user.dir") + "/src/test/drivers/chromedriver");
    driver = new ChromeDriver();
}

public String getURL() {
    return URL;
}

public void setURL(String URL) {
    this.URL = URL;
}

public void execute() {
    try {
        navigateToSite();
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

public void navigateToSite() throws Throwable {

    try {
        driver.navigate().to(URL);
    } catch (Exception ex) {
        ex.printStackTrace();
    }

}

public void setGetTitle() {

}

public void getTitle(String arg1) throws Throwable {
    String actualTitle = driver.getTitle();
    Assert.assertEquals(arg1, actualTitle);

}

}

2 个答案:

答案 0 :(得分:0)

您的TEST_SYSTEM被定义为“苗条”,但ColumnFixture要求TEST_SYSTEM定义为“适合”。

答案 1 :(得分:-1)

遇到类似的例外。试试这个:

!path /home/ninad/git/fitnesse/fitNesse/target/classes

!|import|
|fitnesseconcept.fitNesse|