Forum Discussion
I contacted the support team few days and here is the replay we get.
There is another way you can bring the mht file path. you can include a Log.File command to which will save an instance of the file you want to keep in the local test directory. Link on how to use the method is below:
https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/file.html
I am not sure how Log.File will work in this case.
Thanks
Nishchal
Hrm.... OK, I THINK I know what they are saying...
so, in your code, you call the Log.ExportToFile method to export the MHT. They are suggesting adding the Log.File method after that to pull that MHT file into the log. That log is then copied back to your local machine as part of the CBT log. Your MHT file is then there and present, just need to save the attachment.
- tristaanogre5 years agoEsteemed Contributor
Unfortunately, that's not going to be possible due to how the test are run against the CBT environments. Think of each CBT environment run as being another machine running another copy of your project. So, you'll have 150 different MHT files that you will pull back and store.
- nisgupta6 years agoValued Contributor
Little bit help needed here . Attached here is the file which shows how we are iimplementing this MHT report.
Now Log.File need to put where ?
Thanks
Nishchal
- tristaanogre6 years agoEsteemed Contributor
I would add to the end of exportMHTReport a call to Log.File to attached the indicated file. It really is that simple. Just a call to make sure that the MHT file is included in the log so that, when the CBT execution is complete, it's returned back in the generated log.
Again, what you need to remember is that MHT export that you're doing is exporting the MHT to a local hard drive on the virtual machine that CBT spins up. And when the execution is done, that file is gone. To persist that file back to your main machine, you need to do something to bring it back. Log.File does that.
https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/file.html - nisgupta6 years agoValued Contributor
Thanks for the updates .
We have one more challenging issues. How can I run this script ? I have attached the CBT workspace screenshot showing that if the script is put in the CBT workspace then it will fail.
Thanks
Nishchal
-
- nisgupta5 years agoValued Contributor
- tristaanogre5 years agoEsteemed Contributor
Well, first of all, if this is a different problem than the OP... would be better if it was it's own thread.
Second of all... I'm not entirely sure what you're asking. If a script is added to a workspace, it will attempt to run. If it fails, what are the errors? What messages? HOW exactly does it fail? Just saying "If I put it here, it fails" doesn't tell me much of anything.
- nisgupta5 years agoValued Contributor
We want to export the MHT report after running the CBT tests.
our CBT tests are running against different OS and Browsers
Once the CBT tests finished running then we want to export the MHT report.
We do have MHT report script which we want to run all the tests finished.
Now if we add the script the CBT test workspace then in CBT all the test script run in parallel and so the report script will run in parallel too.
Thanks
Nishchal
- tristaanogre5 years agoEsteemed Contributor
Right... so... what changed? We gave a recommendation of attaching the MHT file to the log which is then pulled back to the main TC machine used for execution. This would pull back MHT files from all CBT environments as they are executed. Is this not working?
- nisgupta5 years agoValued Contributor
Nothing changed.
we discussed about the Log.File statement to be put in Report script but again that script will be run as parallel with other script.
- tristaanogre5 years agoEsteemed Contributor
Right. That's fine. I don't see any reason why that would be a problem. The log will pull back the files and such from the CBT environment per test run... that is, unless you're experiencing some other error that you haven't told us. But that is the recommendation... even if they are running in parallel, this should work because each log is kept separate per machine that it's run on.
Related Content
Recent Discussions
- 2 days agovladd1