Hey,
i want to get the name of the current TestCase into an e-Mail i send after finishing a testrun.
I tried TestReport.CurrentTestCaseActivity.TestCaseName, TestReport.CurrentTestModuleActivity.TestModuleName and several other commands, but the Mail-Logger fails to send emails if i try.
Is there an easy way to get the name of the current Testcase as a string?
Thank you in advance
JcNvG
Get TestCase Name in Report
Re: Get TestCase Name in Report
Hi,
Email is usually sent as a last action in test suite, when the test suite is actually finished and there is no way to obtain current test case, because there is no longer "current" test case available.
What exactly do you want to achieve?
Could you please show us the structure of your test suite and location/implementation of email module?
Email is usually sent as a last action in test suite, when the test suite is actually finished and there is no way to obtain current test case, because there is no longer "current" test case available.
What exactly do you want to achieve?
Could you please show us the structure of your test suite and location/implementation of email module?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Get TestCase Name in Report
Thank you for the quick reply!
After finnishing the test-runs, an email is sent, containing the Ranorex-Logfile as PDF. The email-body contains a short test-summary, which is structured like this at the moment:
Test-Name: [Name Test-Data] - Status: [success/fail] - ...
Test-Name: [Name Test-Data] - Status: [success/fail] - ...
Test-Name: [Name Test-Data] - Status: [success/fail] - ...
and so on...
The Suite contains severel Test-Cases. Every Test-Case is linked with an individual Excel-Data-Connector in which the Test-Data is stored.
I want to Add the Name of the Test-Case to the short summary in the email-body, so it should look like this:
Test-Case: Test-Case #1 - Test-Name: Data 1 - Status: success
Test-Case: Test-Case #1 - Test-Name: Data 2 - Status: failed
Test-Case: Test-Case #1 - Test-Name: Data 4 - Status: success
Test-Case: Test-Case #3 - Test-Name: Data 2 - Status: success
I think it should be possible because we already save the status and the name of the Test-Data.
I added a Screenshot of the TestSuite-structure. As seen, the MailLogger is user-code.
After some research i noticed, that there exists a method, which records the data used in a particular test-case. After finnishing the entire Test-Case, the recorded information is set into the mailbody.
I think i have to record the TestCase-Name inside of that "list" through that method.
This makes sense, yes.Email is usually sent as a last action in test suite, when the test suite is actually finished and there is no way to obtain current test case, because there is no longer "current" test case available.
After finnishing the test-runs, an email is sent, containing the Ranorex-Logfile as PDF. The email-body contains a short test-summary, which is structured like this at the moment:
Test-Name: [Name Test-Data] - Status: [success/fail] - ...
Test-Name: [Name Test-Data] - Status: [success/fail] - ...
Test-Name: [Name Test-Data] - Status: [success/fail] - ...
and so on...
The Suite contains severel Test-Cases. Every Test-Case is linked with an individual Excel-Data-Connector in which the Test-Data is stored.
I want to Add the Name of the Test-Case to the short summary in the email-body, so it should look like this:
Test-Case: Test-Case #1 - Test-Name: Data 1 - Status: success
Test-Case: Test-Case #1 - Test-Name: Data 2 - Status: failed
Test-Case: Test-Case #1 - Test-Name: Data 4 - Status: success
Test-Case: Test-Case #3 - Test-Name: Data 2 - Status: success
I think it should be possible because we already save the status and the name of the Test-Data.
I added a Screenshot of the TestSuite-structure. As seen, the MailLogger is user-code.
After some research i noticed, that there exists a method, which records the data used in a particular test-case. After finnishing the entire Test-Case, the recorded information is set into the mailbody.
I think i have to record the TestCase-Name inside of that "list" through that method.
You do not have the required permissions to view the files attached to this post.