我收到错误Could not invoke constructor
。我所有的课程都是正确的。
Division Fixture实际上曾经用过但现在已经破裂了。我从来没有让我的Selenium FitNesse工作。
任何想法?
代码:
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);
}
}
答案 0 :(得分:0)
您的TEST_SYSTEM
被定义为“苗条”,但ColumnFixture
要求TEST_SYSTEM
定义为“适合”。
答案 1 :(得分:-1)
遇到类似的例外。试试这个:
!path /home/ninad/git/fitnesse/fitNesse/target/classes
!|import|
|fitnesseconcept.fitNesse|