Software Testing Class

Running Tests And Organizing Tests In Fitnesse

Once the FitNesse set up is completed, next step is to write test scripts and run them properly to get the right results. In this chapter, we are going to see how to organize test scripts in FitNesse and how to run them in order. Ordering and grouping are very important when we want to have a clean set of test scripts. Let’s dig in to the organizing first.

Organizing Tests In FitNesse:

When we discuss about organizing tests in Fitnesse, there are no standard rules but logical order. Let me explain this in detail with an example. Say, you have a website which you want to test using automated scripts using FitNesse tool. You have got 4 different pages to test namely Home, About Us, and blog and Contact US. To write fixtures and use them in FitNesse, you will have to write four different autotest scripts, one for each web page OR if a web page has multiple features then you will write autoscripts for each feature to test it thoroughly and then include that script under a test suite which has all the test scripts related to that web page. It is similar to grouping of test cases where similar kind of test scripts are grouped together under the same suite. To identify each of them, “Tags” can be used. You will find this property under “properties” on the left hand side bar of FitNesse.

Now, let’s understand what is meant by “logical order”? So, when you test any software, there is always an order which should be followed for most effective testing practice.

Consider the below web page.

Fitnesse Test Run

We have three main things to test, contact form, comment form and then social media. Fitnesse will have 3 auto test scripts namely

WebTesting.ContactAndSocialMediaTesting.ContactForm,WebTesting.ContactAndSocialMediaTesting.CommentForm,WebTesting.ContactAndSocialMediaTesting.SocialMedia

All the above three will come under one suite namely

WebTesting.ContactAndSocialMediaTesting. Here, the logical order would be to test contact form first then social media and last is comment form. Since to leave a comment, person has to sign in using any of his social account.

Running Tests In Fitnesse:

Once you have created all the auto test scripts, there are two ways to run the FitNesse tests:

When you run them in a whole suite form then tests run in an alphabetic order and show results accordingly. The whole suite either passes or fails. For running tests in suite, tester must follow a particular sequence. There will be a set up at the beginning and tear down at the last. SET UP will do all the necessary actions to prepare the tests to execute and TEAR DOWN will undo all the changes made to database and other places while running that particular test script. This could be understood better with an example.

When test is ran individually or you can say independently then there is no need to define any order (mainly alphabetic names of the test). Run the test and get the result.

Important things to remember while organizing and running tests on FitNesse.


Over To You:


⇓ Subscribe Us ⇓


If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below:


 

Check email in your inbox for confirmation to get latest updates Software Testing for free.


  Happy Testing!!!
 
Exit mobile version