/// <summary> /// /// </summary> public List <string> Run() { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Current task: Get event log messages"); var eventLog = new EH.PCPS.TestAutomation.DeviceCare.V10107.Functions.ApplicationArea.Page_Settings.Page_Settings_Functions(); var statusFunction = new EH.PCPS.TestAutomation.DeviceCare.V10107.Functions.StatusArea.Statusbar.Statusbar_Functions(); statusFunction.OpenEventLog(); Delay.Milliseconds(3000); //check if event log has entries List <Element> children = eventLog.GetChildrenList(); if (children.Count >= 1) { if (children.Count == 1) { eventLog.LogContainsExactlyOneEvent = true; } eventLog.PopulateListsWithEventLogMessages(); eventLog.ConstructEventLog(); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Eventlog is empty. No messages to provide"); eventLog.EventLogMessages = null; } return(eventLog.EventLogMessages); }
/// <summary> /// /// </summary> public bool Run() { //instantiate all modules var connectionStatus = new EH.PCPS.TestAutomation.DeviceCare.V10107.Functions.StatusArea.Statusbar.Statusbar_Functions(); var execFunction = new Functions.Helpers.InterfaceHelpers.DTMFunctions(); var devScreen = new EH.PCPS.TestAutomation.DeviceCare.V10107.Functions.ApplicationArea.Page_DeviceScreen.Page_DeviceScreen_Functions(); devScreen.IsAdditionalFunction = false; devScreen.DeviceFunctionName = "OfflineParameterization"; Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Current task: Disconnect device (toggle offline)"); //check if device is connected and store value bool isConnected = connectionStatus.IsDeviceConnected(); if (isConnected) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Device is in online state. Checking if device supports offline functionality..."); //check if device supports offline functionality //else return false and user warning devScreen.ClickFunctionMenu(); if (devScreen.IsDTMFunctionMenuShown()) { if (devScreen.IsOfflineSupported()) { //device supports offline functionality Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Device supports offline functionality. Toggling offline..."); //toggle online devScreen.ToggleOnline(); Delay.Milliseconds(2500); if (connectionStatus.IsDeviceDisconnected()) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Successfully disconnected the device"); return(true); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Could not disconnect the device"); return(false); } } else { //device does not support offline //report a warning and return false Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The device does not support offline functionality. Cancel disconnecting the device..."); return(false); } } } else { //device is already connected -> do nothing and return Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The device is already in offline state"); return(true); } return(false); }