Forum Discussion

mathieuleb's avatar
mathieuleb
Contributor
10 years ago

Test that generate Test?

I ask in other thread, but my question was not clear and I accidentally click accept the answer.

http://smartbear.com/forums/f74/t92222/it-is-possible-to-instantiate-test-items/



I have a UI Test (Test1) with parameter X Y Z, and I need to run this multiple time, and all the parameters are in a configuration file.  We can't create manually a test items for each entry.



I want to run to be able to run new test instance.



Ex:

-Test2 run a script that call new tests:

    -Test1_1

    -Test1_2

        ...



The problem is that I want stop on error on sub-test level (Test1), not on Test2



It's possible to do that?



My only solution at the moment is to create a temporary ".mds" file that I will generate from my configuration.  And I really don't like this solution



Thanks



18 Replies

  • Ok here the main thing I want:



    Script1 (which is in a test item) run multiple Test2, I want "stop on error" with Test2, but I don't want it to stop the execution of Script1



    ex:



    Script1 Start:

        Test2_00 sucesss

        Test2_01 fail

        Test2_02 sucesss

        Test2_03 sucesss







  • Marsha_R's avatar
    Marsha_R
    Champion Level 3
    Can we see more detail or a sample test please?  How do you want to use parameters?  I think that's where our misunderstanding is.  
  • Forgot the parameter at the moment, let say I just need to pass a string in parameter.



    What is blocking and I need to resolve is that:



    Script1 (which is in a test item) run multiple Test2, I want "stop on error" with Test2, but I don't want it to stop the execution of Script1



    ex:



    Script1 Start:

        Test2_00 sucesss

        Test2_01 fail

        Test2_02 sucesss

        Test2_03 sucesss




    Thanks!



  • Marsha_R's avatar
    Marsha_R
    Champion Level 3
    See the attached screenshots for how we use DDT to loop through an Excel spreadsheet.  We pass parameters to the main test and to the DDT, and we enter different data on each pass from the spreadsheet.  



    I think you should be able to use something similar to pass a string in and then if you encounter an error, then have it drop down to the Next.  
  • Thanks for the answer, but even with your example, I can't do what I want.



    See attachement.  If I have 5 iteration in my file, if one of the test have an error, the loop stop.



    It's impossible to get 5 loop of a test
  • simon_glet's avatar
    simon_glet
    Regular Contributor
    Hi Mathieu,



    I have been following this thread and I was wondering if there was not another way to look a your requirement.



    Instead of having one TC script running a list of tests, would it be possible to separately invoke Test1_1, Test1_2, Test1_x from the command line ? That would allow one test to fail without stopping the subsequent ones to run.

    The only drawback I see is that you would will have one log file per test instead of one grouping all the tests.



    Depending on the repeat logic complexity, there are many solutions to invoke the TC or TE command line and pass arguments: dos batch, Powershell, Python etc.



    Sincerely
  • My current solution at the moment is to create automatically test items and create a temporary test complete solution.  So it will be Test1_1, Test1_2, Test1_3, etc.  But I need to create a custom tool to do that.



    The problem is that we can't maintain manually the test items because there's too many possibilities, that's why we need to instanciate (or generate) them.  And we need a result for each of them
  • simon_glet's avatar
    simon_glet
    Regular Contributor
    I agree that you need to implement some kind of external tool to setup and run your tests. Sorry, I don't see any way around that ...



    Sincerely