Forum Discussion

rmnrdi's avatar
rmnrdi
Contributor
7 years ago

Handling errors in DDT

I've created a DDT "framework" that I use to pass data into a test template. This is the function that controls the whole thing: // Start Here function Main() { aqPerformance.Start(); //Used...
  • AlexKaras's avatar
    7 years ago

    Hi,

     

    Not sure if I completely got your question... Also I am not quite sure what state you are talking about here: "if the test fails, the test loses it's state".

    However, maybe this will help:

    -- Your test project must be set up to not stop on error;

    -- Each PopulateXXX() test function must return boolean as an indicator of whether or not the execution of the whole test can be continued;

    -- Transform your main code to something like that:

      var bResult;
        while (!JEDriver.EOF())
        {  
          Log.Message("******************** Test run number " + i + " has Started... ********************************")
        
          bResult = iv.LoadUIVariables(i);
          if (bResult)
            bResult = SetUIVariables(); 
          if (bResult)
            bResult = PopulateIDPage();
          ...
              
          Log.Message("^^^^^^^^^^^^^^^^^^^^^^^^^^^ Test run number " + i + " has finished. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^");  
    
          // you may consider whether or not to continue with the next data loop
          if (!bResult)
            break;
    
          //Indexes to next line of data sources
          i++;
          //Indexes to next line in id file
         JEDriver.Next();       
        }
    ...

    Does this help?