Email & report with task scheduler - automated-tests

I am currently running my test scripts using a batch file & MS task scheduler. However, I would like to have an email sent out to our product team when the test has completed. Email would include a snapshot of the robot framework test report. Is this possible?

The report is a set of HTML files which is not easy to open when distributed by email.
Consider setting up a CI server that can not only send out an email but keep the report on a web server. The email then contains a link to the right report.
I'm using Jenkins at the moment which has a plugin for Robot Framework. It keeps the full history of every test run and publishes graphs with the number of tests passing/failing.

Related

What needs to be done for an action submission?

I am developing a google smart home action.On the Google Home App, I can set up my test action. I can use the Google Home mini turn on my devices. I used a C++ server as fulfillment (url: https://xxxx.xxx.com/google/smarthome). My server can receive and process SYNC, QUERY and EXECUTE methods.
When I running the SMARTHOME-WASHER demo. It used firebase and homegraph. I can see the washer status data in firebase database. I can see the functions in firebase, such as fakeauth, faketoken, reportstate, requestsync and smarthome. Evenytime when I turn on/off the washer. I saw reportstate and other requests.
But when I test my test action, in my test action's firebase, there are nothing. No status data, no request data.
When I use Test suite for smart home, the WASHER-DEMO is OK, my test action failed to get device list from HomeGraph.
So I want to know:
1. If firebase is necessary when I used my own fulfillment ?
2. How to report state? Request from google server to my server, or conversely?
3. When I add my test action on Google Home App, the firebase database is empty. Is this a issue?
4. What need I to do , if I want to submission my action.
I have been troubled for more than two months. Thanks for your help.
Firebase is not required. You can use any backend implementation you want. To simplify development, our codelab uses one type of implementation. If you want to use another host and database, then you can change how you handle the requests.
Report State is a command you send from your server to the Home Graph. It's proactive, meant to be sent when a device's state changes.
If you are not using Firebase for your test action, then you would not see any Firebase activity. This is fine.
To submit, you should follow this guide. Primarily, run the Test Suite and then submit your action through the Actions Console.

Automatically send reports in Email with Cumulocity

In Cumulocity I want to send configured reports automatically in Emails after a certain time period elapsed. Usually reports are sent manually.
I already have a CEP (Complex Event Processing) rule that automatically sends me the Emails, without the report content though.
I am stuck trying to access the configured report templates in the CEP rule.
Does anybody know how and if this is possible?
I am assuming you are talking about the reports in cockpit application.
Currently there is no possibility to trigger the sending of the report from CEP.
What you could do is create a script that you run yourself (e.g. cron) on your own system/server that does the same REST call that the UI also does to trigger the report sending.

How to handle background queries on a DB that supports a Web App

I need some help understanding how I should architect an application. Basically it has two parts.
The web app (asp mvc): A user logs into the app, records some data and logs off. The data (login info, user recorded data) is stored locally on my server. It is very simple.
The background process: I need a service to receive and send data that is connected with this web app (from #1). I have a 3rd party server that will send user login information (in real time) to my server in which I need to use to update my local DB (this is the same DB that the web app uses for login info). Secondly, I need to run a timed interval process to query the user recorded data plus perform simple logic on it and then send the outcome to this 3rd party server. These steps are all via xml docs.
I am not exactly sure how to attack this problem. I figured I could build a separate web service to do this (it would live on the same server as the web app). Or I could run some sort of webbackgrounder (https://github.com/NuGet/WebBackgrounder) task solution that is attached to my web app. Or lastly I could create a SSIS package to do this. Which route should I go? Thank you for the advice.

Run job on ASP.NET website service start in IIS

I have some method that is invoked on Application_Start. And it starts on first page request by any user.
But i have another application, dependent on that task that fires during Application_Start.
So that if IIS/website is restarted- another application cant get some data from website, until someone requests page on the running website.
Is there a way to run some task on website start; without any interaction from user side, just to start website in IIS and do the job i want?
PS more details on implementation architecture:
Website starts an instance of messaging service and starts sending messages through that service(that is located on another server). I know that it would have been better to create wcf or windows service for this kind of things, but someone wrote this website before i was included in this project. So clients(that receive messages from messaging server) do not know anything about website. Here website is just administrative panel to turn on/off some messaging features.
My Solution
Created windows service for my task. Works well, under local system account has no problems with writing to windows event logs.
Check out this "The Dangers of Implementing Recurring Background Tasks In ASP.NET"
Also you should consider installing Quartz.NET as a service, so that you can setup scheduled tasks remotely.
You can try this.
Put an entry in your code into event log
Use the windows task scheduler to create a task
Create a trigger as "Begin the task On an event"
Create the action with the job you want

Send E-mail reminder with ASP.NET

I have a book lending system written with ASP.NET, VB.NET and LINQ to SQL. I want the web app to send the e-mail reminder about the due date to the borrower before the book is over-due. Should I write a desktop app to check the due date or there's another way around to send e-mail reminder?
Thank you for any suggestion.
Write a service or a console app that is run with Windows scheduled tasks, then have that consult the database for due dates, and send out emails accordingly.
Don't use desktop interaction.
Scheduled service. If your LINQ backend is a decent database (like SQL Server), you can schedule a task with the SQL Server Agent and have it fire off emails when necessary. That could be accomplished via script, or a CLR SQL assembly (effectively, a .net assembly that plugs into the SQL server).
Depending on how much traffic the site sees, you could make use of HTTP Cache like how StackOverflow does. You can read about it in this blog post. Although the blog appears to be down right now, so here's the Google cache.
If you write a windows desktop app then it will not run if you don't login in. You can write a windows service and install it in the server and it can send out reminder emails.
I think a windows service is suitable for this task. Take a look at that question about using timer with a windows service.
A great little starter tutorial i have bookmarked for windows services here
I would check out Quartz.NET an open source job scheduler for the .NET platform. You can use it to perform scheduled tasks inside of a Windows service. For example, you could schedule a task to run every morning and have it query your database and then send out an email if the due date of a book is within the range.

Resources