New Test Listeners are not working as expected when My Test case has multiple Call Test Case

Hi,

The below is my structure of code.

1. Call Login Test Case
2. Book Appointment
3. Call Logout Test Case.

I have added to clear history,. kill IEdriverserver.exe in Test Listeners once each Test case completed.

I expected that once all three activity completed it should clear cookies and histories. But Currently after step 1 (called test executed) it clears the cookies and history so that the subsequent test steps getting failed.

How to use Test listeners when I have multiple call Test case in my original Test case.

In your scenario, you should use ‘AfterTestSuite’ trigger as it will call this trigger after all of above activities. Using ‘AfterTestCase’ will trigger steps after one of these activities, so that’s why you see your cookies and histories are cleared.

Thanks for the Reply. My Suite has say eg. 25 test cases… Each Test case has many call Test case… will this solution work out? or this will clear after ONLY executing all 25 test cases?