Forum Discussion

678's avatar
678
Regular Contributor
7 years ago

how to prioritize event

I have a test cases defined in excel like 

 

Datasource = Exel 

 

Column : Prerequsite

                CreateUser;EditUser

 

 

TestCase:     LoginRequest

DataSource: Prerequsite :  Create User Request, Edit User Rquest 

 

 

I have a Event like

 

If datasource Prereq contains Createuser than RUN CreateUserRequest and

If datasource prereq contains edituser than RUN EditUserRequest 

 

So, when i am running above event 1st Create User need to run then edituser should run 

 

but its both running parallel

 

How can i run one bye one like createUser then Edit User 

 

  • Lucian's avatar
    Lucian
    Community Hero

    Hey, can you provide more info on this? Is the Event you're talking about a groovy script? Can you provide us the groovy script? Can you share a print screen of your project for us just to understand you better?

     

    Cheers!

    • 678's avatar
      678
      Regular Contributor

      Well, let me put it in this way 

       

      i have 3 variables storing in datasource as 

       

      1) createuser 2) edituser 3) logoutuser 

       

      and i have event like this: 

       

      if (datasource.contains ("createuser")) {   Then here createuser validation will be execute }

       

      if (datasource.contains ("edituser")) { Then here edit user validaton will be execute } 

       

      if (datasource.contains ("logoutuser ")) { Then here logout validaton will be execute } 

       

       

      Event : TestRunlisitner after step = datasource 

       

      So, Here on my datasource 

       

      If i keep only 1 variable like   -  createuser then event is executing correct 

       

      but if i keep 3 varaibles like - createuser;edituser;logoutuser   

       

      Then all 3 varaibles executing at the same time but my scenario is 

       

      need to excute one by one like 1) createuser 2) edituser 3) logoutuser 

       

       

       

      I hope this help you .. 

       

      Thanks in advance 

       

      • groovyguy's avatar
        groovyguy
        Community Hero

        So one thing I see is that you mentioned having a Data Source with multiple variables / columns, one for each of the tests you want to consider running. And that these tests execute when all three variables are present. Using a data-source for this may take some extra work to get it to function the way you want.

         

        This sounds like an issue that might be solved with a wait/sleep command in groovy. That way, the Create User has time to process. You could build in some sort of check that waits until the Create User has a response, and then process the next steps.