I am using the UiPath libraries to make an executable, see below snip for code:
Variable myBrowserVariable = new Variable<Browser>();
OpenBrowser samsungPortalBrowser = new OpenBrowser();
samsungPortalBrowser.NewSession = true;
samsungPortalBrowser.BrowserType = BrowserType.Chrome;
samsungPortalBrowser.Url = "http://www.youtube.com";
samsungPortalBrowser.UiBrowser = myBrowserVariable;
runWorkflowApplication(samsungPortalBrowser, myBrowserVariable);
The issue with the code is that I do not get myBrowserVariable to gain the value of the Browser I just ran, what is wrong exactly?
In addition, how can I get a strongly typed variable type from myBrowserVariable of type Variable (it should be Browser type), so that I can get the Element.Selector from it?
This is the runWorkflowApplication method:
private void runWorkflowApplication(object ActivityObject, Variable UiPathVariable = null)
{
Sequence createSequence = new Sequence();
try
{
createSequence.Variables.Add(UiPathVariable);
}
catch (Exception e)
{
}
WorkflowApplication createWorkflowApplication = new WorkflowApplication(createSequence);
createSequence.Activities.Add((Activity)ActivityObject);
createWorkflowApplication.Completed += workflow_OnWfCompleted;
createWorkflowApplication.Run();
//while (!Workflow_Completed)
//{
//}
}
Thank you!