Forum Discussion

LAB's avatar
LAB
Contributor
6 years ago
Solved

Any way to have an entire test run within a browser loop?

i.e. I have test 1-9 that I run in order, I can put a browser loop within each case, but then the behavior is test case 1 in chrome, then test case 1 in edge, test case 2 in chrome etc. 

 

Is there a way to set up a browser loop so it runs 1-9 in chrome, then 1-9 in edge?

  • Hi,

     

    it's just a matter of not wanting to have to combine all 9 cases into 1.

    Then your only option is to create a test with Browser Loop parent and Script Code child.

    The Script Code child should read configuration file with the list of tests/code functions to be executed and execute them via eval() or similar function.

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Assuming that we are talking about Keyword Tests and you have Test1-Test9 tests that should be executed within the Browser Loop:

    -- Create a new test;
    -- Add Browser Loop operation to it;

    -- Add Test1-Test9 tests below Browser Loop operation;

    -- Select added Test1-Test9 and indent them so that they appear to be children of the Browser Loop operation.

     

    Does the above work?

     

    Note: Your Test1-Test9 tests must either not attempt to start any browser but just use the already running one (the one that is started by the Browser Loop operation) or include the logic that will use already running browser if it exists or start the new one. (The latter logic option will work if the given test is executed standalone but not within Browser Loop.)

    • LAB's avatar
      LAB
      Contributor

      Thanks Alex, yes, adding them all to one test case would technically work, it's just a matter of not wanting to have to combine all 9 cases into 1. This would require any time I want any combination of tests (which I'm trying to keep dynamic) to be pasted into 1 big case. 

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        it's just a matter of not wanting to have to combine all 9 cases into 1.

        Then your only option is to create a test with Browser Loop parent and Script Code child.

        The Script Code child should read configuration file with the list of tests/code functions to be executed and execute them via eval() or similar function.