Send test result via e-mail in subject
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Send test result via e-mail in subject
I need to run my test project in TestComplete10 every night, and I need to be able to send result (Succeded/Error(s) occurred) as a part of a email subject.
I run the test project through command line (or I should say batch files) and I also use command line to send emails. First I thought that I always send the .mht file as an attachment, but it is to large even after compression, so I cannot use this solution. I read some other threads about this and everybody solves this using TestCompletes SendMail method. So I just wonder if there is some way to get the result from commandline.
Thanks!
Miriam
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this is exactly what I want. It looks really good and it would be really really great if it worked on my project. Unfortunately I was not able to apply this on my test project. It is the GetTestSummary() function which keeps on failing. First because of the: var xDoc = Sys.OleObject("MSXML2.DOMDocument.4.0"); ... for error: Invalid class string: cannot obtain ClassID.
I googled a little and tried to change the version in the argument to 6.0. Then it started to fail on another row: var wrnC = VarToInteger(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="warning count"]/@value').text); ... with message: Object required.
Until that row it seems that everything is working, the Description.tcLog is generated. So now I really don't know what's wrong because I have no experience with parsing text.
Thanks for your help
Miriam
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mere changing of version in the code would not be of much help if MSXML is not installed.
Have you made sure that MSXML 4.0 is installed on your machine?
Have a look into your software (Start -> appwiz.cpl)...
If it is not there in the list of installed programs, here's where you can download it:
http://www.microsoft.com/en-US/download/details.aspx?id=15697
Marin
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It sends the email after each tests. I have a project suite which includes about 8 test items and the count will grow. Is there any chance how to invoke this action only when whole test project ends?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you check: http://support.smartbear.com/viewarticle/56306
You will see the last section:
When to Send Results
If you run a single test, you can call a test command that sends test results directly from this test.
If your run a project with several test items and you need to send the entire test log via e-mail, there is no need to call the appropriate method or command from each test item. You just need to call the desired method from the last test item. For example, you can create a special routine that will send test results and add it to the Test Items page as the last test item.
I hope that helps.
Alex
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, that helped... thank you very much! 🙂
And thank you all guys for help, I owe you a chocolate! 🙂
Miriam
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, I did it the same way, when I found out that it works like that. I just wasn't sure that it could work, because when it's part of a tests it seems that the result is created after this routine is finished. But apparently, the result is created continuously.
So thank you very much again 🙂
Miriam
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First: This thread is over 4 years old so I'm not 100% certain that @marin is active any more. So, it might be better, in the future, to post a fresh thread.
Secondly: Project Suites don't have any code excution capabilities. So, you can't accumulate values per project and then report them all out at the end. Each project is, essentially, a stand-alone test collection with some minor communication via the ProjectSuite variable set.
What you could do (and what I've done) is write out the project results to some sort of file that is stored centrally or into a ProjectSuite variable. Then, have a separate project whose only purpose is to read that stored result set and e-mail it as desired.
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
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 day so 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()
