private void ElementRecordedHandler(ElementActionCongifuration args) { try { Act actUI; ElementInfo einfo = null; if (args.LearnedElementInfo != null) { einfo = (ElementInfo)args.LearnedElementInfo; args.AddPOMToAction = CreatePOM; args.POMGuid = CurrentPOM.Guid.ToString(); args.ElementGuid = einfo.Guid.ToString(); actUI = PlatformInfo.GetPlatformAction(einfo, args); } else { actUI = PlatformInfo.GetPlatformAction(null, args); } if (actUI != null) { if (CurrentPOM != null && einfo != null) { CurrentPOM.MappedUIElements.Add(einfo); } BusinessFlow.AddAct(actUI); } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Error in Element recording event handler while recording", ex); } }
private void AddBrowserAction(string pageTitle, string pageURL) { try { ElementActionCongifuration actConfig = new ElementActionCongifuration() { Description = "Go to Url - " + pageTitle, Operation = "GotoURL", ElementValue = pageURL, LocateBy = "NA" }; ElementInfo einfo = new ElementInfo(); einfo.ElementTypeEnum = eElementType.Iframe; Act actUI = PlatformInfo.GetPlatformAction(einfo, actConfig); if (actUI != null) { AddActionToBusinessFlow(actUI, null); } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Error while adding browser action", ex); } }