Forum Discussion

Kateryna's avatar
Kateryna
Contributor
10 years ago

Rerun keyword test in OnLogError script

Hello, How can I rerun current test, if I receive a specific error in log? I created event handler on Log error and it has following code, but it doesn't work: procedure Gen...
  • AlexKaras's avatar
    10 years ago
    Hi Kateryna,



    I believe that the correct syntax is (untested):

    TestItems2:= Project.TestItems.Current.Name;

    evaluate('KeywordTests.' + TestItems2 + '.Run()');



    However, considering that the test will be started from within the error handler, I am not sure that this is the best approach as it may cause recurrent execution of the same test and exaust memory resources on the test computer.



    As a side note: you should also check that TestItems.Current is not nil, which is true if a standalone test/keyword test was executed.