-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_CodedWorkflowExample.cs
38 lines (30 loc) · 1.2 KB
/
01_CodedWorkflowExample.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Windows.Forms;
using UiPath.CodedWorkflows;
using UiPath.Core.Activities;
namespace CodedAndLowCodeWorkflow
{
public class _01_CodedWorkflowExample : CodedWorkflow
{
[Workflow]
public void Execute()
{
// 1. Open Application
var ACMESite = uiAutomation.Open("LogIn");
// 2. Get Assets from Orch.
Log("Reading UserName & Password from UiPath Orch Assets...");
var credential = system.GetCredential("ACME_Credential", null, out var password, CacheStrategyEnum.None, 30000);
// 3. Type Into UserName
ACMESite.TypeInto("Email", credential);
// 4. Type Into password
var actualPassword = new System.Net.NetworkCredential(string.Empty, password).Password;
ACMESite.TypeInto("Password", actualPassword);
// 5. Click the Submit button to perform the Login
ACMESite.Click("Login");
//6. Check if Screen Changed
var dashboard = uiAutomation.Attach("Dashboard");
var Description = dashboard.GetText("User options");
// 6. Display Message
Log("Dashboard Appeared..");
}
}
}