Forum Discussion

SlickRick's avatar
SlickRick
Contributor
2 years ago

The current row position is already beyond the table

Hi all, im ecountering a very weird error when im running my execution plan.

 

I have a test that will return this error : 

The current row position is already beyond the table

 

 


The error is returned at the very end of my keyword test and the last script executed seems to have run successfully. I have also added a log to ensure that it is the case and that no errors occurred during the script.
 
If i run the test alone it works fine and without any errors. This occurs only if i run my whole execution plan.
 
The next test also works fine.
 
Not too sure what could be the cause of this error... 😕
 
 
  • Ideally, you should have try...catch...finally, but that depends what your coding is doing!

     

    That error is most likely relating to e.g. having only either 10 files or records and reading the 11th item that doesn't exist. You should be able to debug and step into your code to pin point the possible "coding error".

     

    • SlickRick's avatar
      SlickRick
      Contributor

      rraghvani no the copying steps are successfull. In fact the whole script function seems to execute correctly.

      The error seems to be encountered after the last step is complete. The following test does the same thing (fails after the last step is done running).

      To me it seems like TestComplete tries to move to another step but fails to do so (since there is no more).

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Put your coding in the try section.

    try {
      // Insert your code here
    } catch (e) {
      // Posts an exception message to the test log
      Log.Error(e.message);
    }

    to see if it produces any useful messages?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Ideally, you should have try...catch...finally, but that depends what your coding is doing!

     

    That error is most likely relating to e.g. having only either 10 files or records and reading the 11th item that doesn't exist. You should be able to debug and step into your code to pin point the possible "coding error".

     

  • So i managed to find the error.

     

    It was indeed on my side and was due to a variable used in many of my test where the iterator was not reset. 

     

    It was almost impossible to debug using a breakpoint for a keyword test since this would occur very late in the test execution plan.

     

    The way i managed to find the bug was to convert the keyword test at fault to a script. Only then the error was showing me the correct line that threw the error.

     

    I really wish that the error log of testcomplete was improved with a more verbose version. Often i find it hard to really know what is causing an issue since there is not a lot of description.

     

    Thanks rraghvani for your help.

  • To add a bit on this, i notice that if i tell my test to continue the execution the following test also throws the same error and again it fails on my last keyword test item but it did success to run the step correctly.

  • Ok i think i found what is the cause. 

    It might be related to the fact that i have a try...finally without a catch. If there is an error while running this The current row position is already beyond the table error is shown.

    My goal here was simply to make sure that certain piece of "code" is always run no matter what is the outcome of the test.


    Im not 100% sure that this is indeed the case, but looks like it. If i add catch to all my tests that have a try finally i seem to have no problems.

  • Well it seems like my test are not really passing, but swallowing the errors when i use the catch.

    What is weird is that im getting different behavior if i run the test alone vs run all my tests.

    If i run the test alone, i have a checkpoint that fails (real fails) and the error is shown as expected.

    If i run multiple tests, my test still fails, but silently. Im guessing that the catch is handling the error, dont so the error in question then continue the execution.

    With a Catch statement i would expect a silent fail like my second case, but what bothers me is that there is different behavior.

    What im really looking for would have been a Try... Finally without any catch but it seems like the this feature is buggy or i just dont get how to use it properly...