Could not invoke constructor

1.7k views Asked by At

I am getting an error Could not invoke constructor. All my class paths are proper. The Division Fixture actually used to work but now is broken. I have never gotten My Selenium FitNesse to work. Any Ideas?

Wiki: enter image description here

Code:

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

There are 2 answers

0
Mike Stockdale On

Your TEST_SYSTEM is defined as "slim" but ColumnFixture requires TEST_SYSTEM defined as "fit".

1
LeslieHT On

Met similar exception. Try this:

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

!|import|
|fitnesseconcept.fitNesse|