elsa-core/src/samples/console/Elsa.Samples.RpaWebConsole/Program.cs
lucapisano 7cba107913
RPA Web Activities (#1279)
* defined open, close and navigate activities

* sample created

* inherit DriverId

* ClickElement added

* implemented TypeText activity and NavigateToW3School sample

* OpenBrowser headless mode

* RPA: GetText added

* fix readme

* try/catch pattern in base class. Thanks to sfmskywalker for the tip

* Update components.d.ts

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2021-08-07 19:07:48 +02:00

28 lines
947 B
C#

using System.Threading.Tasks;
using Elsa.Samples.RpaWebConsole;
using Elsa.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Samples.RpaWebConsole
{
class Program
{
private static async Task Main()
{
// Create a service container with Elsa services.
var services = new ServiceCollection()
.AddElsa(options => options
.AddRpaWebActivities()
.AddConsoleActivities()
.AddWorkflow<NavigateToWebsite>())
.BuildServiceProvider();
// Get a workflow runner.
var workflowRunner = services.GetRequiredService<IBuildsAndStartsWorkflow>();
// Run the workflow.
//await workflowRunner.BuildAndStartWorkflowAsync<NavigateToWebsite>();
await workflowRunner.BuildAndStartWorkflowAsync<NavigateToW3School>();
}
}
}