[FitNesse] Use files for I/O

Hi there, 

 

I have a question related with the use of files to  read or write data while using FitNesse for Appian. For example, use a file to store variables to use within the script in FitNeese or write some data from a FitNesse script. I have been searching throught the forums but I didn't find anything about it, even if it is possible to use this kind of feature.

If it is not possible to use this feature, do you know if FitNesse is thinking on realeasing it?

 

Thank you so much!

  Discussion posts and replies are publicly visible

Parents
  • I'm not aware of any way to read variables from a file.  The best way I've found to manage variables is to use JSON and populate it into a test variable at the beginning of the script.

    | set test variable | VARIABLE_NAME | with | JSON_VALUE |

    For example

    | set test variable | Order | with | {"name":"Test Order","amount":"100","customer":"Bob"} |

    You can then access this variable using tv!Order.name, tv!Order.amount, etc throughout your test script.

    Using Appian, it's very easy to create a form with all of your different variable inputs and then use a!toJson to generate the JSON output needed for the FitNesse script.

  • Hey there,
    Apart from above method you can also use below methods to generate test data
    !|script |
    |$var= |get random string |3 |
    |$var1=|get random alphabet string|4 |
    |$var2=|get random integer from |20|to|2000|
    ***!
    or create a Java class file with all your test data and call that class file to Fitnesse jar file folder and call that java class in your scripts.
    !|script|javapackagename.classname|
    |class |
  • Hey I'm interested in the Java class version you wrote. Can you give a sample java class as well as the script syntax to read and/or write from that Java class?
Reply Children
No Data