Contributions
Log.SaveResultsAs() does not give a value for "error test count" field
I am trying to get some information from the logs after my final test has completed but when I call Log.SaveResultsAs() from code some of the fieldsin description.tclog are not filled in. "error test count" and "warning test count" are always 0. I have an event handler for OnStopTest() where I call Log.SaveResultsAs(tempFolder, lsXML) from the final test. Even though all of the tests have been executed,"error test count" and "warning test count" are always 0. I tried callingLog.SaveToDisk() right before I callLog.SaveResultsAs() hoping that it would flush the buffer but I am still seeing some of the values in description.tclog set to 0. Any ideas on how I can get the log file generated with the updated values (including "error test count") from my scripts? I don't want to have to add another project, I would prefer to do this from the OnStopTest() event handler (I do check that the log is only written for the final test)1.3KViews0likes4CommentsRe: Log.SaveResultsAs() does not give a value for "error test count" field
Yes, I verified that several of the tests that ran before I dumped the logs have errors. Interestingly, the "error count" field is > 0 but "error test count" = 0. When the program stops, the log file that is created shows the correct error test count even though no new tests have been run. Unfortunately, I really need to get the error test count while the program is running. I was hoping to get this from the OnStopTest event handler.1.2KViews0likes2CommentsRe: SuccessTestCount is not updating in description.tclogfile
I tried calling Log.SaveToDisk() right before I callLog.SaveResultsAs() hoping that it would flush the buffer but I am still seeing some of the values in description.tclog set to 0. After TestComplete finishes, the log file is updated with the correct values but I need to know how many test cases have failed when I call Log.SaveResultsAs().1.2KViews0likes1CommentRe: SuccessTestCount is not updating in description.tclogfile
Does anyone know the answer for this? I am finding that if I do aLog.SaveResultsAs(tempFolder, lsXML); from the final test that several of the attributes in the Description.tcLog are not correct. "error test count" is always 0 in the exported results even if several tests have already failed.1.2KViews0likes2CommentsRe: Send test result via e-mail in subject
Thanks all, this method of querying for results is very handy. I did implement a similar method to export our test results to a temporary directory and then parse the Description.tcLog for the results. We want to call GetTestSummary() after all of the tests have been run. I have this hooked up to the OnStopTest event. Our test project has a large number of tests so I want it to only run GetTestSummary after the last test. Is there a straightforward way to do this? I prefer not to hardcode the name of the final test. We may enable/disable certain tests on any given dayso I cannot guarantee that a given test will be run. An alternative is to query the project for all enabled tests and try to determine the final one to complete. Has anyone considered this issue? I could add another test item that does nothing but trigger the reports but this seems a little brittle as it must be at the end of all of the tests. /* Event handler for the OnStopTest event */ function GeneralEvents_OnStopTest(Sender) { var name = Project.TestItems.Current.Name; if (Project.TestItems.Current.Name == "MyLastTest") { GetTestSummary()2.4KViews0likes1CommentRe: Send test result via e-mail in subject
Hi Marin, your suggestion looks great. I have just one follow-up question. In our setup, we have several projects that will run from within the same projectsuite. Ideally, I would like to get an e-mail that says something like: ProjectA: 10/10 tests passed ProjectB: 8/10 tests passed Is there a way to maintain results per project in your example. Best Regards.2.4KViews0likes1Comment