C# Customization

Ask general questions here.
CharlesCuozzo
Posts: 5
Joined: Tue Nov 27, 2012 4:13 pm

C# Customization

Post by CharlesCuozzo » Tue Nov 27, 2012 4:22 pm

I am evaluating Ranorex in order to automate the retrieval of some reports and report data from a Flex-based application. By using the recording option, I have been able to produce one of the reports (using multiple selections of different controls on the application) and save it as a PDF file on the test machine. What I need to do next - hopefully using the same executable produced by Ranorex - is to email the saved PDF file to multiple users.

I have already seen that you have some code samples to email test results and so on. I'm just wondering if these same samples can be modified and additional C# code added to the end of the test run in order to email the report.

I guess a more general question is: Can I add C# code that is unrelated to the Ranorex APIs and to the test per se to the end of the C# code generated by Ranorex. The ultimate goal is to use the Ranorex recording and C# API to first produce the report and then to add custom code to deliver it to users, all in the same executable that Ranorex creates. A related concern is where this code would go in terms of the Ranorex-created code.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: C# Customization

Post by Support Team » Tue Nov 27, 2012 4:59 pm

Hello,

Please take a look at our blog Customizing Ranorex Reports.

Attached you will find a project which you can use to send reports via email.
Enter the email address in Program.cs for sender and recipient.
Additionally, you need to change network credentials for SMTP in the PrepareAndSendMail() method in MailLogger.cs.

You could rename the extension of the report file into XML and open it in Internet Explorer as an alternative to PDF. You could write C# code after Report.End() in Program.cs in order to be executed after a test.

Regards,
Markus (T)
You do not have the required permissions to view the files attached to this post.