fitnesse

Interpret a variable in a table marked with an exclamation mark


I have a method that take a screenshot (a bmp file), and return it path. The file is stored in a directory name passed as parameter, which is the name of the current test, and I want the file name to be prefixed by the actual date:

!define date {!today (YYYYMMddhhmmss)}

!|script  |screenshot                                                |
|$capture=|take screenshot;|${RUNNING_PAGE_NAME}|${date}_{$file_name}|

My problem is the RUNNING_PAGE_NAME variable is interpreted only if I put an exclamation mark before the table (else Fitnesse render a link to the actual page). But, because of the exclamation mark, the date isn't interpreted anymore and I have this result:

!today (YYYYMMddhhmmss)_file_name

What I want instead:

20220704083616_file_name

Is there a solution that allows to tell Fitnesse to interpret some variables but not all ones ?


Solution

  • You can use a ^ instead of an exclamation mark. That way the wiki will parse symbols, but not links/e-mail adresses.

    See documentation at: http://fitnesse.org/FitNesse.UserGuide.FitNesseWiki.MarkupLanguageReference.MarkupTable