Forum Discussion

anand7892's avatar
anand7892
Occasional Contributor
6 years ago

Running complete project with different set of data

There are n test suites in my project.

1. Login

2. Test suite1

3. Test suite 2

      .

      .

      .

Test Suite n

Above test cases are user dependent and for every user we have different set of data.

I want to run above all test case with different users i.e.with different set of data.

Run All test suite for first user and then run all test suite for second user and so on..

 

Any leads will be appreciated.

Thanks,

Anand

 

6 Replies

  • Hi anand7892

     

    As far as i have understood, what you wanna do is Run Each and Every TestSuite with different set of data,

     

    What you can do is parameterize your Test Data, store the username and related data into some excel or if it is not too much then store it in Properties either at Project Level or create Global Properties.

     

    Now, when you run TestCases, it will get executed with new data because you have parameterized your hard coded data with dynamic data.

     

    If no clue how to do Parameterization then go through Working With Properties

     

     

    Click "Accept as Solution" if my answer has helped, and remember to give "kudos" :)

     

    Thanks and Regards,

    Himanshu Tayal

     

    • anand7892's avatar
      anand7892
      Occasional Contributor

      HimanshuTayal

       

      I want to run all my test suite with set of data :

       Firstly execute all test suites with first set of data and

       when all suites execution got completed,

      then start executing all test suites with second set of data 

      and so on

       

      I know parametirization but not sure how to apply them for above scenario

       

      Thanks for reply

  • Radford's avatar
    Radford
    Super Contributor

    I am a little hesitant to too come in on this thread, because as richie said "there's lots of different ways of doing this", and there is nothing wrong at all with the suggestions he's made and anything I say could end up just causing more confusion. Sorry if it does.

     

    All I can do is say how I would approach this issue. When you describe your problem I immediately think of data driven testing, the following link is a good introduction to doing this in ReadyAPI:

     

    https://support.smartbear.com/readyapi/docs/testing/data-driven/index.html

     

    I personally would look at how your tests are structured, as Ready API provides various tools to implement data driven testing, like the DataSource Test Step which when paired with a DataSource Loop Test Step, allows you to iterate over a set of test steps repeatedly different sets of data within a single test case.

     

    This brings me to my next point, I always consider that a Test Case should be a test that is independent and runnable on it's own, with no prerequisites. To do this I usually have within my project a "Common Library" test suite where I turn all of my common functionality into test cases (for example a "Login" test case), then within the actual standalone test cases make heavy use of the Run TestCase test step. Your Test Suite then just groups your independent test cases into logical groups for easy running and reporting.

     

    Take a look at my posts in these threads, as I talk more about modularising and reusing test cases (particularly the first link):

     

    https://community.smartbear.com/t5/SoapUI-Pro/How-to-loop-Test-Suites-or-Test-Cases/m-p/144149/highlight/true#M32579

     

    https://community.smartbear.com/t5/SoapUI-Pro/Need-help-to-modularizing-tests-using-soapui-pro/m-p/163164/highlight/true#M36686

     

    As I mentioned at the start I hope this helps a bit and doesn't cause too much confusion.

  • richie's avatar
    richie
    Community Hero

    Hi anand7892

     

    Can you expand the detail you provided a little - I'm a bit confused.

     

    You state you have 3 test suites - Login, TestSuite1, TestSuite2 - is that right?

     

    You have different users exercising the 3 different test suites....is that right?

     

    You want each of your users to exercise all 3 test suites - sequentially? 

     

    Does a user need to exercise the Login test suite first?

     

    How is the user details saved?  what consists user data? (i.e. is it just username?  username/password? user/password/additional creds?)

     

    Are you asking how to set this up? - the approaches to datasources?  how to pass the user details to the steps?

     

    Is it REST? SOAP?

     

    The title of your post is "Running complete project with different set of data" - does this mean you actually have >.1 project (.wsdl, .wadl, whatever) and you have a set of users that you want to use to exercise >1 project?

     

    I'm sorry - I feel like I've bombarded you with questions - but if you can try and answer these - it'll help people grasp exactly what you need!

     

    Cheers,

     

    rich

    • anand7892's avatar
      anand7892
      Occasional Contributor

      richie

      Pleae find my answers inline

       

      You state you have 3 test suites - Login, TestSuite1, TestSuite2 - is that right?

      Right

       

      You have different users exercising the 3 different test suites....is that right?

      Right

       

      You want each of your users to exercise all 3 test suites - sequentially? 

      Sequentially or parallel , both work for me

       

      Does a user need to exercise the Login test suite first?

      yes

       

      How is the user details saved?  what consists user data? (i.e. is it just username?  username/password? user/password/additional creds?)

       

      There are lots of parameter specific to user that will be used in subsequenet test suites.

       

      Are you asking how to set this up? - the approaches to datasources?  how to pass the user details to the steps?

      Yes, i am asking how can i set this up 

       

      Is it REST? SOAP?

       REST

       

      The title of your post is "Running complete project with different set of data" - does this mean you actually have >.1 project (.wsdl, .wadl, whatever) and you have a set of users that you want to use to exercise >1 project?

      I have 1 project and want to execute  all my test suites , firstly for user1 and then for user2 and so on..

       

      Let me know if you have any other questions.

       

      Thanks for your reply.

       

      Thanks,

      Anand

      • richie's avatar
        richie
        Community Hero

        Hi anand7892

         

        there's lots of different ways of doing this - you say you know about parameterization and property transfer -  but there's many, many ways to do this - also the question is quite open ended - so without lower level details (like examples of the REST requests in the various test suites) we can't really steer you in the 'right' direction - I can just give you an example of how I might do this is as follows - this isn't necessarily the 'best' approach - this is just one that I've used before and there were various reasons why I picked this rather than others at the time.

         

        This is difficult to answer unless you can give me example request content for all your requests but for now I can summarise what I did.

         

        Short answer - I created a properties file with my login parameters which I sourced as the first step in the first testcase in my Login test suite.  I used parameterization and property transfer to grab the session variables from the Login test suite's initial test case (is there going to be more than 1 test case in the Login suite?) to pass onto the later tests in the Login Suite as well as passing them onto the test cases within the 2 Test Suites.

         

        Just some notes on the properties files

         

        I used a properties file rather than set them within SoapUI, just cos I find it easier to edit .csv's rather than fields in soapui.  I created a properties file (.csv extension) - not .txt - I'm specifying the .csv for a number of reasons - SoapUI handles .csv's by default more effectively than .txt, although you can still do everything you can with a .txt as a .csv as far as I can tell.

        The properties.csv content format had 1 header row, data row started at row 2 - it appears as follows:

         

        firstname, lastname, userid, password
        dave, jones, dj01, QAZWSX01
        susan, peters, sj02, XSWZAQ01

        I created the first testsuite (entitled Login) and the first step of this was a Datasource (file type).

         

        I browsed the datasource (filetype) to the 'properties.csv' file - a dialogue entitled 'Import properties from a file' launches - hit the 'Yes'

        'Import Properties' form launches - hit the 'Ok' to accept defaults - this creates the 4 properties that correspond to the header row in the properties.csv

        Hit the options button for this datasource - this launches the 'Datasource Options' form.

        On the 'Settings' tab, in the 'Start Row' editable field - input '1' and click 'OK'

        Hit the green 'Play' tick to test the datasource works correctly - launches a dialogue - hit 'OK' - this populates the datasource with all the rows of data.

        Hit the green 'Play' tick and when prompted for a number of rows to be retrieved - input '1' (replacing the default '10').

         

         

        The above provides you a datasource of file type - that contains the parameter values might need.

         

        I then add in the REST requests to build the test steps associated with the Login test suite.

         

        I then capture the session variables into properties (correlation) for the TestSuite's 1 & 2 (via project properties or datasinks or whatever) - this means that you can run TestSuites independently rather than having to run them in sequence.

         

        That's how I did it - but as I say - there are a variety of options

         

         

         

        I read the above and I'm unsure if I've really been of help at all, but anyway - its a starting point 

         

        cheers,

         

        richie