Questions regarding Appian FitNesse tool


#AppianFitNesse

I am working on Appian FitNesse and there are some bottlenecks which I would like share. If anybody has encountered the same limitations in Appian FitNesse and have overcome them, please suggest those solutions.

1.          Looping in Appian FitNesse
          
          There is a scenario where I want to run a Test Page multiple times by getting the test data from CSV or Database dynamically.
          Is there any looping method to achieve this.

2.          Conditional Statement in Appian FitNesse

          I have a requirement where if a condition is true, I want to execute some statements, else execute some other statements.
          In other words does Appian FitNesse has If Else statement in it.
          Ex: if(condition 1)
                    {
                              Statement 1
                    }
                    else
                    {
                              Statement 2
                    }
          I know there is a "check" keyword/method in Appian FitNesse but it doesn't suffice my above requirement. Please suggest if there is some method which I can use with "check" to achieve...

OriginalPostID-224959

OriginalPostID-224959

  Discussion posts and replies are publicly visible

  • @sidhantb I was also looking for the same. Thanks for identifying and posting the question.
  • @Sidhantb,AFAIK we dont have looping and conditional statements in FitNesse.
    may be we can accomplish this as a work arround.
    Build a scenario that will populates the Input values e.g.

    |scenario |populate Test Form |text|int|decimal|datetime|datetime|
    |populate field|Title |with |@text |
    |populate field|Quantity |with |@int |
    |populate field|Price |with |@decimal |
    |populate field|Start Date |with |@date |
    |populate field|End Date\ t |with |@date\ t|

    Build a scenario that will Verifies the Input values e.g.
    |scenario |Verify Test Form |text|int|decimal|datetime|datetime|
    |verify field|Title |with |@text |
    |verify field|Quantity |with |@int |
    |verify field|Price |with |@decimal |
    |verify field|Start Date |with |@date |
    |verify field|End Date\ t |with |@date\ t|

    The below Script acts as a test Data for the Scenario that Populates fields.
    |scrip t|
    |populate Test Form|BeanBags|10|150.3|2016-12-12 |2016-12-20|

    Now add a Verify Script

    |scrip t|
    |Verify Test Form|BeanBags|10|150.3|2016-12-12 |2016-12-20|

    Now Add the above Two scripts repeatedly changing the Test Data from the Scripts itself to acheive looping functionality.

    Note: This may not be the good idea for large chunks of Test Data, still can be used in conjunction with Boundary Value Analysis technique to limit the Test Data.

    let me know your views on this
  • 0
    Certified Lead Developer
    Can you not use | $VAR | in conjunction with | get field | and | check | to produce an IF equivalent? I would have thought that would satisfy your second requirement?
  • @Sidhantb For the Second Scenario, May be we can Use Negative Testing .
    It goes like below.
    if(input the data that makes condition true)
    {
    In this case these Statements need to true always i.e the output of this always true.
    }

    if(input the data that makes condition false)
    {
    In this case these Statements need to false always i.e. the output of this always false
    (but still the Test cases are passed since we expected Negative Output)
    }
    I'm not sure this satisfies your testing scenario.
  • 0
    Certified Lead Developer
    I had a quick look at what I suggested, and unfortunately it doesn't look possible as Fitnesse for Appian doesn't yet support decision tables - at least that's what it looks like to me. Might be worth an enhancement request?
  • @chandrasekharg - As I have mentioned above if I want to fetch data from CSV or DB then I am not sure how much data is present so the approach has to be dynamic and even if I write scenarios I have to invoke them manually. So might not suffice my requirement.
    And about the 2nd point where you suggested the negative testing,can you please provide a sample Fitnesse script where we the above mentioned approach is achieved. Because the limitation in Appian Fitnesse is we cannot have a conditional statement with a scope.
  • @philb - Please elaborate in which context you are using decision table in the above comment because Fitnesse supports decision tables and as Appian Fitnesse is an extension of that, it also supports decision table.
    Please refer the below link.
    http://www.fitnesse.org/FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable
  • @sidhantb. I agree we don't have facility to populate fields from CSV or DB. You need to populate the fields manually by writing the Scripts. Hope we may get this further FitNesseForAppian versions.

    Regarding the Second scenario. Yes we don't have the conditional statements also.
    I just want to know what type of statements you want to execute in the conditional statements. Do you simply want to populate the fields based on a condition or you want to check verification. Could you please elaborate the scenario in detail so that we can think for work arround.