Forum Discussion

sastowe's avatar
sastowe
Super Contributor
13 years ago

long data driven test graceful error recovery

I have a data driven test that I am thinking about how to recover from errors with grace and resume. On error, I would like to resume the test in progress by starting over the row in the driver xls upon which the test failed. Is this possible? Thanks

S

  • I'm far from an expert on this, but I don't think it's possible.  For example, in TC, there is no getRow() or setRow() methods for the driver.  I'm not sure why that is, but they don't exist.  What I've done to sort of get around that is to create a run flag in the datasheet.  If the flag is "Y" then it runs the row.  if not, we skip it and move on.
  • Stephanie,



    In case of an error, you can skip the test command that moves the pointer to the next row in the data source. Here is the pseudo-code:


    While Not Driver.EOF      ' While the driver has data to retrieve


       ...                                 ' Do some testing here ...


       If Success Then            ' If there was no error


          Driver.Next                '    Switch to next data


       End If                           ' Else, the Next command is skipped and the test continues with the same data


    WEnd



    As you can see, to achieve what you want, you have to implement the data-driven loop commands in your tests. 


    This approach will not work if you have a keyword test with the Data-Driven Loop operation in it. This operation does not let you control the execution of the "Next" command.
  • sastowe's avatar
    sastowe
    Super Contributor
    Oh yah. I was thinking all complicated. Simple. Nice. Thanks.