Forum Discussion

MarekFric's avatar
MarekFric
Occasional Contributor
9 years ago

Realtime results in TestExecute

Is it possible to see/get test results in real time(as soon as possible) ?

 

If I run suite of 12 tests on all connected devices(3) I see if there is any issue as soon as all tests are finished(in more than 1 hour) :-(  . I'd like to know during test run if there is some issue and in which test. Does this feature exist in current version of TestExecute because I didn't find it ?

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    No, there is no such feature because the test log as a whole does not exist until the test execution is over (but the approach mentioned by Tanya will certainly work).

    However, you may implement a handler for the OnLogError event (see help for more details on this and other mentioned TestComplete objects), get the name of the currently running test item (not a test code procedure name, but test item name), craft some message string and display it on the screen using the Indicator object.

     

    Also, despite the full log is not available during test run, its .ErrorsCount, .WarningsCount, etc. properties contain actual values. So the simpler solution is also possible:

    -- Create a Temporary Project Variable with initial value of 0 (zero);

    -- Implement a handler for the OnTestStop event;

    -- Within this handler, get the number of errors posted to the log;

    -- Find the difference between the current number of errors and the value of the temporary project variable;

    -- If the difference is not zero, this will mean that the given number of errors was posted to the log within the given test;

    -- You can output obtained information using the mentioned Indicator object.

     

    Does this help?

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi MarekFric,

     

    At the end of each test (or in any place in your tests) you can save the test log via Log.SaveResultsAs This won’t stop the test execution. So, you can review the test results while another test is being executed.

     

    You can go forward and automate even this process. You can create your own function that will parse the saved test log and search for any errors posted to it. If the error was found, the function will stop the test execution or will jump to execute some other test. Please review to the Scripting Access to the Test Log Contents article for details.