How to Log the Failure/Error when running the test

Hi all,

I’m running the test where if the test fails, it would write to an Excel worksheet saying that the test failed. I managed to get that to work, but I also lost the ability to see what went wrong with the test. I would like to see the detailed failure/error report again or get something tangible to see where the test failed again.

Is it possible to get that back? And if so, what would I have to do to print the stacktrace?

Let me know

i suggest look into testNG/JUnit case. In “afterMethod” you can just check if test failed/passed and wrote this into your Exsel file. If it fails you can get where it fails and what fail message is - and again if needed enter it into your excel file. not needed just do nothing - after all test run you will get something like for testNG (i removed sensitive data):

Tests run: 73, Failures: 7, Errors: 0, Skipped: 0, Time elapsed: 8,072.733 sec <<< FAILURE! - in TestSuite
Test_0001(com.xxxxxxx  Time elapsed: 65.773 sec  <<< FAILURE!
java.lang.AssertionError: 'Recipient' input NOT loaded
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.assertTrue(Assert.java:43)
	at com.xxxxxxl(xxxxxx.java:46)

.....


Results :

Failed tests: 
  xxxxxx.xxx:46 'Recipient' input NOT loaded
  ......

Tests run: 73, Failures: 7, Errors: 0, Skipped: 0

Hi Aleskei,

I failed to specify, I have to write UI tests in python using Appium for my job, so I’m tied down to Python and Appium.