質問

I am having a problem in setting my symbols and retrieving them using Fitnesse symbols. I am creating a new class called Carrier which is a simple Java bean which takes a WebDriver object.

My Java implementation for setting symbols looks like this:

public class ColumnFixtureTest extends ColumnFixture{

    private WebDriver driver;

    public Carrier together(){
        driver = new FirefoxDriver();
        Carrier c = new Carrier();
        c.setMyDriver(driver);
        return c;
    }

}

My Java implementation for retrieving them looks like this:

public class SymbolsTest extends ColumnFixture{

    private Carrier symbolValue;

    public boolean check(){
        if(symbolValue.getMyDriver()!=null){
            return true;
        }
        return false;
    }
}

My carrier object looks like this:

public class Carrier {

    WebDriver myDriver;

    public WebDriver getMyDriver() {
        return myDriver;
    }

    public void setMyDriver(WebDriver myDriver) {
        this.myDriver = myDriver;
    }



}

My Fit table looks like this :

!|ColumnFixtureTest|
|=together()|
|comb|

!|SymbolsTest|
|symbolValue=|check?|
|comb|true|

But after running it, I am getting the following error:

comb
Could not parse: com.symbolTest.Carrier@5ed75ed7, expected type: com.symbolTest.Carrier.

My value is getting set properly though as :

comb = com.ebay.srp.symbolTest.Carrier@5ed75ed7

Any help would be appreciated. Stuck with this for a while now :(

役に立ちましたか?

解決

I haven't used the Fit tables in a long time now. I suspect that the problem is that the ColumnFixture class cannot move instances of objects back and forth. It may either only work with stock types that can be expressed as strings. But I could be way off on that.

Is there a reason you are using Fit style tables? I would either recommend that you look at Slim, or go to FitLibrary. For WebDriver testing, FitLibrary has SpiderFixture and there are projects already using WebDriver for Slim (Xebium being an option).

I do know this. Passing around object references in a symbol is supported in Slim.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top