Forum Discussion

Kateryna's avatar
Kateryna
Contributor
10 years ago

Timer doesn't work after starting keyword test from the script

Hello,



I have script that starts specified keyword test using KeywordTests.MyTest.Run() method.

In this keyword test I run script where I start Timer like this:



Utils.Timers.Cear;

Utils.Timers.Add(65000,'TestSetUp.TimerRoutine', true);



That runs procedure in the same script test:



procedure TimerRoutine;

begin

Log.Error('Test stopped on timer');

Runner.Stop(true);

end;



When I run my keyword test by itself - everything works well and I receive message in log. Bug if I start it from the script - Timer doesn't work and there is no message in the log.



Anyone have any ideas?


8 Replies

  • Thank you for a quick reply - but I tried that one - it works only if you run project suite, but if you want to start separate keyword test, as I do in my case, that timeout won't work.
  • I've played around with trying to reproduce the problem to no avail.  Perhaps you could post a simple zipped project...?



    Which version of TestComplete?
  • If you run the project you'll see that after test was rerun Timer had to write to the log error with following message: "Test stopped on timeout". But I received no message.
  • AlexanderLinkov's avatar
    AlexanderLinkov
    SmartBear Alumni (Retired)

    Hello,


    As far as I understand, you want to call TestSetUp.TimerRoutine when the timer elapses. But, in your example, you do not call the TestSetUp routine to set this timer.


     


    For example, the Delay routine should look like this:


     




    uses TestSetUp;


    procedure Delay;


    begin


      TestSetUp.TestSetUp();


      aqUtils.Delay(68000);


    end;




     


    Does this solve your problem?