Forum Discussion

littlebear2's avatar
littlebear2
New Contributor
6 days ago

TestComplete occasionally skipping a test step.

Hello all,

I have made a test that has three steps, and am running it in an Azure DevOps pipeline.

Step 1: Click 'Save and Close'. This is an ordinary button at the end of a form. Once it is clicked, the page takes some time to load the save (this varies between 3-20 seconds). During that time the page looks like this:

Clicked Save and Close button - bottom right of image

Step 2: Click 'View Record'. This is a button that appears after the page has been loaded, and disappears about 5 seconds later. Note: Because of the variable time that it takes to save the record, I have set the Auto-wait Timeout for the step to be 30 seconds. This could then click on the object after the form was saved, no matter how long it took.

View Record button - top right of image

Step 3: Click 'Save'. After the View Record button has been clicked, you are taken to the Record, and there is a Save button on the main page.

Save button - top middle of image

Here are the three steps in the test:

 The test, when run in the pipeline, will occasionally fail with the following error:

You would expect that the step right before the failure is Step 2: Click 'View Record'. But the picture shows that it is Step 1: Click 'Save and Close', and its place in the log also shows that it is Step 1. It jumps from Step 1 to Step 3: Click 'Save'. Of course, it can't find the Save button, because it hasn't clicked the View Record button (at least, there is no indication in the logs that it has). Does anyone have an idea of what is happening here?

Thanks,

littlebear

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    Hello,

    As it is an intermittent problem it would be hard to debug and isolate. To help make better sense, also view the log steps pictures not just the details, I found pictures are better at reveling the nature of such anomalies.

    Since these steps could take a long time to finish, I suggest that on each step to add "page Wait" of next item before proceeding to the next step. 

    I also suggest you add debug code to catch it if and when it happens, add to each step "If Object" "Exist=true and VisibleOnScreen=true" and "Else" "Post Screenshot" statements.

    • littlebear2's avatar
      littlebear2
      New Contributor

      Those are all good ideas. I've added some Screenshot steps to the test. But the weird thing to me is that, according to the logs, the second step isn't even running. It clicks the Save and Close button and then goes right to looking for the 'Save' button, though there is an important step in between.

      I'll have more info if it fails again with screenshots. Thanks for your help!

      • Hassan_Ballan's avatar
        Hassan_Ballan
        Frequent Contributor

        I am wondering if your log column is sorted rendering these entries out of order. It does not make sense TestComplete skipping an action. 

  • littlebear2's avatar
    littlebear2
    New Contributor

    Note: This does not always happen when the pipeline is run. It seems to happen about 30% of the time, and it is not in a consistent pattern that I can see. The rest of the time, the steps are run correctly.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    A few years back, I remember someone having similar issues. I remember in Azure DevOps, it used to run tests in random order, and I don't know if the latest version of Azure DevOps allows to define tests, in order.

    This was on of the main reasons for me not using Azure DevOps, and instead running my Execution Plan (ordered tests) via PowerShell script