protected Process RunApplication(string processName) { //Validate if (string.IsNullOrEmpty(processName)) { throw new Exception(InformationResources.ERROR_EXTERNAL_APPLICATION_PROCESS_NAME_EMPTY); } //Get application process identificator var process = Process.GetProcesses().FirstOrDefault(p => p.ProcessName.Contains(processName)); //Set Window on Top Win32ApiHelper.SetWindowTopMost(process); return(process); }
public void ReloadActiveBrowserPage(string shipmentId) { var topMostBrowser = GetOrderedBrowserProcesses().FirstOrDefault(); if (topMostBrowser != null) { try { var shipmentUriData = GetShipmentUriData(); if (!shipmentUriData.IsDataCorrect() || shipmentUriData.ShipmentNbr != shipmentId) { return; } Win32ApiHelper.SetWindowTopMost(topMostBrowser); _automationUtils.RefreshBrowserCurrentPage(); } catch (NetworkActiveUriNotFoundException) { //Just do nothing, not reload browser } } }