Forum Discussion

evertonalmeida's avatar
evertonalmeida
Occasional Contributor
8 years ago
Solved

I would like to known if is there any configuration when the TestComplete not find a object

I would like to known if is there any configuration when the TestComplete not find a object on screen, run a specific action

  • tristaanogre's avatar
    tristaanogre
    8 years ago

    What you've described is an event tied to the tests, not to the project. When a test fails due to an object not found, stop the test, reset, and start the next test. This is something that needs to be handled in the framework of the tests that you are running. Each test should be wrapped in some sort of handler that will do exactly what you are asking.

    Unfortunately, there is nothing that I know of that is built in to the TestComplete environment to do what you ask. I could easily be wrong but, in my years using the product in its various versions, the solution you are asking for is something that needs to be developed as part of your testing framework.

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    There is an option in project properties to stop execution if a window/object is not found. See https://support.smartbear.com/viewarticle/80861/

     

    Beyond that, you will need to build your own handling for when an object is not found to perform specific actions. My suggestion would be to build some sort of method/function/script that you would call any time you want to check for interaction with an object. Within that method, utilize one of the WaitNNN methods (see https://support.smartbear.com/viewarticle/82625/?q=WaitNNN#WaitMethods) and, if the result of the "Exists" check returns false, then execute your custom code.

    • evertonalmeida's avatar
      evertonalmeida
      Occasional Contributor

      First , thanks for you answer .

      I know the "wait window" property , or "wait object" . But I want this for the project and not to the specified test .

      I have a tree of tests , and I want that if a test not found the object , do a action. This action is , close the system , open the system and continues to run the next test of tree.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        What you've described is an event tied to the tests, not to the project. When a test fails due to an object not found, stop the test, reset, and start the next test. This is something that needs to be handled in the framework of the tests that you are running. Each test should be wrapped in some sort of handler that will do exactly what you are asking.

        Unfortunately, there is nothing that I know of that is built in to the TestComplete environment to do what you ask. I could easily be wrong but, in my years using the product in its various versions, the solution you are asking for is something that needs to be developed as part of your testing framework.