/// <summary> /// This method is used to get the new WindowExplorerPage based on Context and Agent /// </summary> /// <returns></returns> private void LoadWindowExplorerPage() { this.Dispatcher.Invoke(() => { bool isLoaded = false; if (mWinExplorerPageList != null && mWinExplorerPageList.Count > 0) { AgentPageMappingHelper objHelper = mWinExplorerPageList.Where(x => x.ObjectAgent.DriverType == mContext.Agent.DriverType && x.ObjectAgent.ItemName == mContext.Agent.ItemName).FirstOrDefault(); if (objHelper != null && objHelper.ObjectWindowPage != null) { mCurrentLoadedPage = (WindowExplorerPage)objHelper.ObjectWindowPage; isLoaded = true; } } if (!isLoaded) { ApplicationAgent appAgent = AgentHelper.GetAppAgent(mContext.BusinessFlow.CurrentActivity, (GingerExecutionEngine)mContext.Runner, mContext); if (appAgent != null) { mCurrentLoadedPage = new WindowExplorerPage(appAgent, mContext); mCurrentLoadedPage.SetDriver(WindowExplorerDriver); if (mWinExplorerPageList == null) { mWinExplorerPageList = new List <AgentPageMappingHelper>(); } mWinExplorerPageList.Add(new AgentPageMappingHelper(mContext.Agent, mCurrentLoadedPage)); } } xSelectedItemFrame.Content = mCurrentLoadedPage; }); }
private void ExplorerAgentButton_Click(object sender, RoutedEventArgs e) { ApplicationAgent AG = (ApplicationAgent)((Button)sender).DataContext; if (AG.Agent != null) { if (((Agent)AG.Agent).Status == Agent.eStatus.NotStarted) { StartAppAgent(AG); } //TODO: Temporary to launch Web service window, till we merge web services to window explorer if (((Agent)AG.Agent).Driver is WebServicesDriver) { ((WebServicesDriver)((Agent)AG.Agent).Driver).LauncDriverWindow(); return; } //if (((Agent)AG.Agent).Driver is IWindowExplorer) //Once all the driver implementing IwindowExplorer are ready, simply checking is IWindowExplorer will server the purpose and flag IsWindowExplorerSupportReady can be removed if (((Agent)AG.Agent).IsWindowExplorerSupportReady) { WindowExplorerPage WEP = new WindowExplorerPage(AG, mContext); WEP.ShowAsWindow(); } else { Reporter.ToUser(eUserMsgKey.DriverNotSupportingWindowExplorer, ((Agent)AG.Agent).DriverType); } } }
public FilterElementsPage(ObservableList <UIElementFilter> filteringCriteriaList, ObservableList <UIElementFilter> checkedFilteringCreteriaList, /*RoutedEventHandler elementSearchEvent,*/ WindowExplorerPage windowExlorerPage) { InitializeComponent(); SetControlsGridView(); FilterElementsGridView.DataSourceList = filteringCriteriaList; CheckedFilteringCreteriaList = checkedFilteringCreteriaList; SetCheckedValues(); mWindowExlorerPage = windowExlorerPage; }
private void InitilizeWindowExplorer() { ApplicationAgent applicationAgent = new ApplicationAgent(); applicationAgent.Agent = mWizard.mAgent; string targetApplicationName = App.UserProfile.Solution.ApplicationPlatforms.Where(x => x.Key == mPOM.TargetApplicationKey).FirstOrDefault().AppName; applicationAgent.AppName = targetApplicationName; mWindowExplorerPage = new WindowExplorerPage(applicationAgent, null, WindowExplorerPage.eWindowExplorerPageContext.POMWizard); mWindowExplorerPage.WindowControlsGridView.DataSourceList = mPOM.MappedUIElements; mWindowExplorerPage.HorizontalAlignment = HorizontalAlignment.Stretch; mWindowExplorerPage.Width = 700; xWindowExlorerFrame.Content = mWindowExplorerPage; }
private void StartAppAgent(Agent agent) { AutoLogProxy.UserOperationStart("StartAgentButton_Click"); Reporter.ToGingerHelper(eGingerHelperMsgKey.StartAgent, null, agent.Name, "AppName"); //Yuval: change app name to be taken from current app if (agent.Status == Agent.eStatus.Running) { agent.Close(); } agent.StartDriver(); if (agent.IsShowWindowExplorerOnStart && agent.Status == Agent.eStatus.Running) { WindowExplorerPage WEP = new WindowExplorerPage(new ApplicationAgent()); WEP.ShowAsWindow(); } Reporter.CloseGingerHelper(); AutoLogProxy.UserOperationEnd(); }
private void StartAppAgent(ApplicationAgent AG) { AutoLogProxy.UserOperationStart("StartAgentButton_Click"); Reporter.ToStatus(eStatusMsgKey.StartAgent, null, AG.AgentName, AG.AppName); if (((Agent)AG.Agent).Status == Agent.eStatus.Running) { ((Agent)AG.Agent).Close(); } ((Agent)AG.Agent).ProjEnvironment = mContext.Environment; ((Agent)AG.Agent).BusinessFlow = mContext.BusinessFlow; ((Agent)AG.Agent).SolutionFolder = WorkSpace.Instance.Solution.Folder; ((Agent)AG.Agent).DSList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <DataSourceBase>(); ((Agent)AG.Agent).StartDriver(); //For ASCF, launch explorer automatically when launching Agent if (((Agent)AG.Agent).IsShowWindowExplorerOnStart && ((Agent)AG.Agent).Status == Agent.eStatus.Running) { WindowExplorerPage WEP = new WindowExplorerPage(AG, mContext); WEP.ShowAsWindow(); } Reporter.HideStatusMessage(); AutoLogProxy.UserOperationEnd(); }
private void StartAppAgent(ApplicationAgent AG) { AutoLogProxy.UserOperationStart("StartAgentButton_Click"); Reporter.ToGingerHelper(eGingerHelperMsgKey.StartAgent, null, AG.AgentName, AG.AppName); if (AG.Agent.Status == Agent.eStatus.Running) { AG.Agent.Close(); } AG.Agent.ProjEnvironment = App.AutomateTabEnvironment; AG.Agent.BusinessFlow = App.BusinessFlow;; AG.Agent.SolutionFolder = App.UserProfile.Solution.Folder; AG.Agent.DSList = App.LocalRepository.GetSolutionDataSources(); AG.Agent.StartDriver(); //For ASCF, launch explorer automatically when launching Agent if (AG.Agent.IsShowWindowExplorerOnStart && AG.Agent.Status == Agent.eStatus.Running) { WindowExplorerPage WEP = new WindowExplorerPage(AG); WEP.ShowAsWindow(); } Reporter.CloseGingerHelper(); AutoLogProxy.UserOperationEnd(); }