cancel
Showing results for 
Search instead for 
Did you mean: 

Report do not contain error informa. Only the log before the error occurs using the Log.SaveResultsA

nisgupta
Valued Contributor

Report do not contain error informa. Only the log before the error occurs using the Log.SaveResultsA

Here is the case

we use Log.SaveResultsAs  to export the log in MHT format.

 

We stop the script as soon as the error occurs and thus export the log but it display the log before error .

Attached the screenshot.

 

Please update 

Thanks

NG

 

11 REPLIES 11
nisgupta
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

Also attached the exportLog() implementation.

tristaanogre
Community Hero

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

What you have described is correct behavior.  Basically, the OnLogError event handler interrupts that act of logging the error.  The error is not written to the log until the event handler exits.  This is to allow the event handler to make any necessary modifciations to the error (or skip it entirely) before it is written to the log.  

 

Rather than the SaveResultsAs going into that event handler, I'd actually put it in the OnStopTest event handler.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
nisgupta
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

@tristaanogre

 

Thank you for the updates 

 

If we look at the screenshot we are putting the SaveResultsAs into OnStopTest event handler I am calling the function exportlog which is in in the OnStopTest event.

 

Then also we are having the issues.

 

Thanks

NG

m_essaid
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

Hi @nisgupta

 

I think I organize myself differently.

I have several tests within a Project. Each test stops at the first error that occurs, but the Project is not set to "stop on error". I could test the feature A, B and C of my application in respectively the test A, B and C.

I add a last test item in which I only prepare my mail, prepare my log with the scope of the whole project.

If A and C go OK and B goes not OK, I'll have 4 test items in my log : A, B, C and the last test item in which I write the log and send my mail.

Every item is loggued entirely (until any eventual error, of course).

Mind the call stack of the last item in error in the report to see everything.

I hope this will help,

Mehdi

nisgupta
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

@m_essaid

 

That look like we need to create one test items for logging and exporting  for every projects , right to make the things work ?

 

 

nisgupta
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

Any other suggestions ?

m_essaid
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

well, I don't know how do you organize yourself but my projects coult contains 40 or 50 test item and could need 4 hours of playback so one item for each is not a problem.

nisgupta
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

@m_essaid

 

I follow your strategy . Seem like for now it look fine, and I can now see the errors in exported MHT report  I have attached the screenshot - TClogseetinga and TClogsetting.

 

Also attached the TCProjectlog.

 

Let me know 

 

Thanks

Ng

 

 

 

 

 

 

m_essaid
Valued Contributor

Re: Report do not contain error informa. Only the log before the error occurs using the Log.SaveResu

yes that's it, you could see a test which is always "green" (it's the last test), but I don't really use the pie in the report.

please mark post as solution if you accept it 🙂

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors