Forum Discussion

m_essaid's avatar
m_essaid
Valued Contributor
7 years ago

catching the place (procedure, function...) that trigger en event

Hi,

 

I have a test that is particular. I mean, it's a data driven test and I loop into it from one time to... "x" times.

I have some complications with this test.

And if in the mail that the robot send, in all other tests, I could know if the test have been executed (even if it has failed), in this particular test, because of the fact that the number of loops is unknown I can't do as I do on the other tests.

 

(I hope that my descriptions is a little bit clear...)

 

So ! I would like to catch, on the OnLogError, the procedure (say "DataDrivenTest1") that was in error.

 

The LogParams.MessageText is not usefull.

The Sender.Name only contains "GeneralEvents"

 

Is there a way to do that ?

 

Thank you very much,

 

Note : I pass this problem by using a boolean that is set to false at the begining of each loop and true at the end. Hence, I only have to test is it is True to consider that all the loops that have begun have ended. But I'm not satisfied by this solution...

 

Mehdi

2 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    What about the "CallStack" tab of the log? It should give you an exact place from where the error was triggered.

    Also you can get more details from LogParams.AdditionalText

    • m_essaid's avatar
      m_essaid
      Valued Contributor

      Hi baxatob

      thank you for your reply,

      as a matter of fact I need to know that "by the code"... hence the robot will know, at the end, when it writes the mail, that the data driven test has not done all the loops...