Exporting checkpoint test results?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Exporting checkpoint test results?
I am looking for a way to export checkpoint results from a test suite run into tabular form - something like a CSV or Excel spreadsheet. Is there a quick and easy way to do this?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's nothing natively built in to TestComplete to do that, no. You'll have to build a method to add rows to a CSV or Spreadsheet after executing your checkpoints.
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That does not surprise me. Where can I look to find resources to develop such a method? Is there an API for TestComplete that I missed in the documentation somewhere?
Thanks.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To be more specific with regard to my last question...
Are there log object(s) that I can use to create a JavaScript method? I found a Log object that allows me to write messages, errors, warnings, and etc. But I didn't find anything that was suitable for parsing out log results.
Thanks again.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're probably looking for this:
https://support.smartbear.com/testcomplete/docs/reference/project-objects/project/project/logs.html
However, what I was suggesting was something a bit more real-time than that. That method requires that you auto-save your logs every so many minutes during a test run and then run the method that you right at the very end of the test run. You then need to parse through the log items to find what you're looking for and then dump them out.
Instead, what I would suggest is build a wrapper around your checkpoints that you use when you create your checkpoint code. It might look something like the following pseudocode.
function checkpointCustom() { //execute the checkpoint if (checkpoint == passed) { writetofile('check point passed') } else { writetofile('checkpoint failed') } }
That way you have control over the write out to the file right away without needing to parse through the log objects to find the specific information you want.
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Robert. As always, your responses are thoughtful and clear.
I have too large of a legacy of KWT's to be modified for you suggestion to be practical for our situation (if I had only thought about this more in the beginning...).
I am looking to go in a different direction - looking at the OnLogCheckpoint and OnLogError events. It looks like I need both (one for "pass" and one for "fail" checkpoint results. The code will notionally look something like this...
function GeneralEvents_OnLogCheckpoint(Sender, LogParams)
{
KWT = ParseForKeywordTestname(Project.TestItems.Current.ElementToBeRun.Caption);
Checkpoint = ParseForCheckpointName(LogParams.MessageText);
Result = "Pass";
TimeStamp = GetNow();
PrintToReport(KWT, CheckPoint, Result, TimeStamp);
}
function GeneralEvents_OnLogError(Sender, LogParams)
{
if (ParseForErrorType(LogParams.MessageText) == CHECKPOINT_TYPE)
{
KWT = ParseForKeywordTestname(Project.TestItems.Current.ElementToBeRun.Caption);
Checkpoint = ParseForCheckpointName(LogParams.MessageText);
Result = "Fail";
TimeStamp = GetNow();
PrintToReport(KWT, CheckPoint, Result, TimeStamp);
}
}
I am sure it will need quite a bit of tweaking, but I think I have a path forward now 🙂
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An elegant solution. Glad it's working for you!
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
