Using data from fitnesse table as a variable

2019-08-02 18:33发布

问题:

I'm just getting started with Fitnesse. I am trying to use a result of a query (number?) and with that result use it in another test fixture. so e.g.

!|Create Account                                                                                    |
|Contractor No  |Account State  |Account Name  |Account Type  |Invoice Template Name|Number?|Result?|
|${ContractorNo}|${AccountState}|${AccountName}|${AccountType}|${InvoiceTempName}   |       |TRUE   |

!|Check Account                      |
|AccountNo           |Account Exists?|
|(result from number?)|TRUE          |

is there anyway of doing this? ive tried this: SymbolTestTables, but this seems to be for one entire record instead of just the result from one function.

As i said im new to fitnesse so i apologize if this is easy.

回答1:

I think the page you are referring to is the Fit style symbols.

I recommend that folks either use Slim, or move to FitLibrary; as both are better supported than just FIT.

If you are doing things the Slim way, you would want to look at this page: Symbols in tables

And if you were doing the Slim way, your table would look like this:

!|Create Account                                                                                    |
|Contractor No  |Account State  |Account Name  |Account Type  |Invoice Template Name|Number?               |Result?|
|${ContractorNo}|${AccountState}|${AccountName}|${AccountType}|${InvoiceTempName}   |$accountNumber=      |TRUE   |

!|Check Account                |
|AccountNo     |Account Exists?|
|$accountNumber|TRUE           |

I'm not as familiar with the FitLibrary style, so I will refer you to their documentation: http://sourceforge.net/apps/mediawiki/fitlibrary/index.php?title=Main_Page



回答2:

With .NET/Fit, you can use << and >> to store and recall values, but I don't know if this is supported with Java:

!|Create Account                                                                                    |
|Contractor No  |Account State  |Account Name  |Account Type  |Invoice Template Name|Number?        |Result?|
|${ContractorNo}|${AccountState}|${AccountName}|${AccountType}|${InvoiceTempName}   |>>AccountNumber|TRUE   |

!|Check Account                      |
|AccountNo           |Account Exists?|
|<<AccountNumber     |TRUE          |