Forum Discussion

stevereissps's avatar
stevereissps
Occasional Contributor
3 years ago

Execution Plan - Indented Statement Logic to Execute On Passing Test Cases

Hi All,

 

I'm using the latest version of TestComplete v15.40

 

In the Execution Plan - Can there be logic in the statements to execute (or NOT) indented statements?

 

(I believe that the Keyword Tests allow this sort of logic - if a statement fails, the indented statements will NOT get executed.)

 

I would need to have something like this : 

 

  [x]  Connect to Remote Machine       (if the test case CAN connect to the remote machine - continue - otherwise skip Remote tests)

      [x]  Remote Test 1

      [x]  Remote Test 2

 

Thanks in Advance!

 

Steve

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Yes, Execution plan allows some kind of such logic.

    For your exact case, you must set the On Error property of the "Connect to Remote Machine" to "Stop current item" value.

     

    What is not supported by Execution Plan is a logic like "Stop current item and continue with next sibling (or parent)"

    Considering your modified example:

      [x]  Connect to Remote Machine

          [x]  Remote Test 1

          [x]  Remote Test 2

      [x]  Run Parallel Tests

          [x]  Parallel Test 1

     

    it is not possible to skip Remote Test 2 if Remote Test 1 fails.

    Also it is not possible to configure Execution Plan so that execution skips Remote Test 2 and continues from Run Parallel Tests if Remote Test 1 fails.

     

    P.S. There is a feature request for this somewhere on the https://community.smartbear.com/t5/TestComplete-Feature-Requests/idb-p/TestXCompleteFeatureRequests page but I am not sure if and when it will be considered.

     

    • stevereissps's avatar
      stevereissps
      Occasional Contributor

      Alex!

       

      Thank you for your response!

       

      I have modified my Execution Plan to "Stop current item" on the remote connection test case.  In the test case, I have the following code : 

       

      if connection_error.Exists:      #  Cannot continue with this routine if error dialog shown.
         connection_error.OK_Button.ClickButton()
         Log.Warning("User Cannot Connect To The Instrument : %s - NO Privileges." % SIMULATOR_NAME)
        return False

       

      Does this error need to be a Log.Error() in order for it to fail correctly and NOT continue?

       

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        Does this error need to be a Log.Error() in order for it to fail correctly and NOT continue?

        Yes, correct.

        The indication of whether test item succeeded of failed is not the true/false value returned by its underlying code/KW test/manual test/BDD feature/etc., but presence or absence of error(s) posted to test log.