/// <summary> /// Starts the current job and runs it to completion, using the specified <see cref="ScanExecutionOptions" />. /// </summary> /// <param name="executionOptions">The execution options.</param> /// <returns></returns> /// <exception cref="DeviceWorkflowException"> /// Unknown AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow /// or /// Unable to press the AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow /// </exception> public override bool ExecuteJob(AutoStoreExecutionOptions executionOptions) { bool success = false; ExecutionOptions = executionOptions; _yOffset = OxpdBrowserEngine.GetBrowserOffset(_controlPanel); _footerPos = GetFooterTop("footerOXPd"); GetButtonIdsTitles(); if (success = PressWorkflowButton() == true) { TurnOnOffOptions(executionOptions, TimeSpan.FromSeconds(20)); if (executionOptions.AutoStoreWorkflow.Contains("Email")) { EmailFormInput(); } else if (executionOptions.AutoStoreWorkflow.Contains("Folder")) { FolderFormInput(); } else { throw new DeviceWorkflowException("Unknown AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow); } ProcessWorkflow(); } else { throw new DeviceWorkflowException("Unable to press the AutoStore workflow requested: " + executionOptions.AutoStoreWorkflow); } return(success); }
/// <summary> /// Initializes a new instance of the <see cref="BlueprintAppBase" /> class. /// </summary> /// <param name="snmp">The SNMP.</param>_ /// <param name="controlPanel">The control panel.</param> protected BlueprintAppBase(Snmp snmp, IJavaScriptExecutor controlPanel) { _snmp = snmp; _engine = new OxpdBrowserEngine(controlPanel, BlueprintResource.BlueprintJavaScript); _newVersion = new Lazy <bool>(false); }
/// <summary> /// Initializes a new instance of the <see cref="JediWindjammerHpacAgentlessAuthenticator" /> class. /// </summary> /// <param name="controlPanel">The <see cref="JediWindjammerControlPanel"/> object.</param> /// <param name="credential">The <see cref="AuthenticationCredential"/> object.</param> /// <param name="pacekeeper">The <see cref="Pacekeeper"/> object.</param> public JediWindjammerHpacAgentlessAuthenticator(JediWindjammerControlPanel controlPanel, AuthenticationCredential credential, Pacekeeper pacekeeper) : base(controlPanel, credential, pacekeeper) { _engine = new OxpdBrowserEngine(ControlPanel); CreateExistElementFunction(); _hpacVersion16_6 = IsVersion16_6(); }
/// <summary> /// Enters the user name, password. /// </summary> protected override void EnterUserNamePassword() { OxpdBrowserEngine engine = new OxpdBrowserEngine(ControlPanel); // The following code is not needed here. SetProvider will have already been called from the base class. See AuthenticatorBase lines 62-66 // In the ISecStar plugin, to force the code to use ISecStar every time, remove the "Auto-Detect" options from the plugin dropdown. //if (!(ControlPanel.CheckState($"{AuthDropdownId} .hp-listitem-text:contains({ProviderMap[provider].SetText})", OmniElementState.Exists))) //{ // SetProvider(AuthenticationProvider.ISecStar); //} engine.PressElementById("username"); ControlPanel.WaitForAvailable("#hpid-keyboard", TimeSpan.FromSeconds(4)); ControlPanel.TypeOnVirtualKeyboard(Credential.UserName); if (ControlPanel.WaitForAvailable(("#hpid-keyboard-key-done"))) { ControlPanel.Press("#hpid-keyboard-key-done"); } engine.PressElementById("password"); ControlPanel.WaitForAvailable("#hpid-keyboard", TimeSpan.FromSeconds(4)); ControlPanel.TypeOnVirtualKeyboard(Credential.Password); if (ControlPanel.WaitForAvailable(("#hpid-keyboard-key-done"))) { ControlPanel.Press("#hpid-keyboard-key-done"); } engine.PressElementById("okayButton"); }
/// <summary> /// Initializes a new instance of the <see cref="JediOmniUdocxScanAuthenticator" /> class. /// </summary> /// <param name="controlPanel">The <see cref="JediOmniControlPanel"/> object.</param> /// <param name="credential">The <see cref="AuthenticationCredential"/> object.</param> /// <param name="pacekeeper">The <see cref="Pacekeeper"/> object.</param> public JediOmniUdocxScanAuthenticator(JediOmniControlPanel controlPanel, AuthenticationCredential credential, Pacekeeper pacekeeper) : base(controlPanel, credential, pacekeeper) { _engine = new OxpdBrowserEngine(controlPanel); _controlPanel = controlPanel; _idleTimeoutOffset = TimeSpan.FromMilliseconds(1000); }
/// <summary> /// Initializes a new instance of the <see cref="iSecStarAppBase" /> class. /// </summary> /// <param name="snmp">The SNMP.</param>_ /// <param name="controlPanel">The control panel.</param> protected iSecStarAppBase(Snmp snmp, IJavaScriptExecutor controlPanel) { _snmp = snmp; _engine = new OxpdBrowserEngine(controlPanel, iSecStarResource.iSecStarJavaScript); _currentVersion = new Lazy <int>(Version); }
/// <summary> /// Initializes a new instance of the <see cref="HpRoamAppBase" /> class. /// </summary> /// <param name="snmp">The SNMP.</param>_ /// <param name="controlPanel">The control panel.</param> protected HpRoamAppBase(Snmp snmp, IJavaScriptExecutor controlPanel) { Snmp = snmp; OxpdEngine = new OxpdBrowserEngine(controlPanel, HpRoamResource.HpRoamJavaScript); _newVersion = new Lazy <bool>(false); }
/// <summary> /// Calls the helping methods for processing the various HPCR workflows. /// </summary> /// <returns>bool</returns> private bool ProcessForHpcr(int pageCount = 1) { bool bSuccess = true; _yOffset = OxpdBrowserEngine.GetBrowserOffset(_controlPanel); TimeSpan ts = TimeSpan.FromSeconds(6); ProcessHPCR_Workflows(); // if the document name is required for this app... if (IsDocumentFieldName()) { SetDocumentName(); // Press the next button PressHpcrButtonByCoordinate("More Options", 0); } VerifyReadyForScanning(true); ProcessHPCR_Work(pageCount, ts); RecordEvent(DeviceWorkflowMarker.ProcessingJobBegin); // press the done button based on its index _engine.WaitForHtmlContains("Done", TimeSpan.FromSeconds(6)); RecordEvent(DeviceWorkflowMarker.ProcessingJobEnd); PressHpcrButtonByCoordinate(string.Empty, 1); AtHomeScreen(ts); return(bSuccess); }
/// <summary> /// Initializes a new instance of the <see cref="JediWindJammerHpecApp"/> class. /// </summary> /// <param name="device">The device.</param> public JediWindJammerHpecApp(JediWindjammerDevice device) { _device = device; _controlPanel = _device.ControlPanel; _engine = new OxpdBrowserEngine(_controlPanel, HpecResource.HpecJavaScript); }
/// <summary> /// Initializes a new instance of the <see cref="HpacAppBase" /> class. /// </summary> /// <param name="snmp">The SNMP.</param>_ /// <param name="controlPanel">The control panel.</param> protected HpacAppBase(Snmp snmp, IJavaScriptExecutor controlPanel) { _snmp = snmp; _engine = new OxpdBrowserEngine(controlPanel, HpacResource.HpacJavaScript); _currentVersion = new Lazy <int>(IsHpac15_4orNewer); }
private const int _footerOffset = 50; // This is based on a 800 x 600 screen. If the screen is smaller, this value will likely need changing. /// <summary> /// Initializes a new instance of the <see cref="JediOmniHpcrApp"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="buttonTitle">The button title.</param> /// <param name="scanDestination">The scan destination.</param> /// <param name="scanDistribution">The scan distribution.</param> /// <param name="documentName">Name of the document.</param> /// <param name="imagePreview">if set to <c>true</c> [image preview].</param> public JediOmniHpcrApp(JediOmniDevice device, string buttonTitle, string scanDestination, string scanDistribution, string documentName, bool imagePreview) : base() { _buttonTitle = buttonTitle; _device = device; _controlPanel = device.ControlPanel; _documentName = documentName; _scanDestination = scanDestination; _scanDistribution = scanDistribution; _imagePreview = imagePreview; _idleTimeoutOffset = device.PowerManagement.GetInactivityTimeout().Subtract(TimeSpan.FromSeconds(10)); _masthead = new JediOmniMasthead(_device); _launchHelper = new JediOmniLaunchHelper(device); _engine = new OxpdBrowserEngine(_device.ControlPanel, HpcrResource.HpcrJavaScript); _screenWidth = _controlPanel.GetScreenSize().Width; if (_screenWidth.Equals(1024)) { _yOffset = 75; _panelBottom = 640; } else if (_screenWidth.Equals(480)) { _yOffset = 40; _swipeBottomIndex = 3; _panelBottom = 215; } }
/// <summary> /// Initializes a new instance of the <see cref="JediOmniHpecApp"/> class. /// </summary> /// <param name="device">The device.</param> public JediOmniHpecApp(JediOmniDevice device) { _device = device; _controlPanel = _device.ControlPanel; _launchHelper = new JediOmniLaunchHelper(device); _notificationPanel = new JediOmniNotificationPanel(device); _engine = new OxpdBrowserEngine(_device.ControlPanel, HpecResource.HpecJavaScript); }
/// <param name="device"></param> public JediOmniUdocxScanApp(JediOmniDevice device) : base(device.ControlPanel) { _controlPanel = device.ControlPanel; _launchHelper = new JediOmniLaunchHelper(device); _masthead = new JediOmniMasthead(device); _idleTimeoutOffset = device.PowerManagement.GetInactivityTimeout().Subtract(TimeSpan.FromSeconds(10)); _engine = new OxpdBrowserEngine(_controlPanel, UdocxScanResource.UdocxScanJavaScript); }
/// <summary> /// SignOut from Udocx /// </summary> private void LogOut() { OxpdBrowserEngine engine = new OxpdBrowserEngine(ControlPanel); if (engine.WaitForHtmlContains(_logoutButton[0], TimeSpan.FromMilliseconds(5000))) { PressButton(_logoutButton[0]); } }
/// <summary> /// Enters credentials on the device by entering the PIN. /// </summary> public override void EnterCredentials() { OxpdBrowserEngine engine = new OxpdBrowserEngine(ControlPanel); ControlPanel.WaitForControl("mOkButton", TimeSpan.FromSeconds(5)); ControlPanel.Press("mOkButton"); base.EnterCredentials(); }
/// <summary> /// HP JetAdvantage constructor /// </summary> public JetAdvantageScanAutoController(PluginExecutionData executionData, ScanOptions scanOptions) : base(executionData) { var device = (IDeviceInfo)executionData.Assets.First(); _device = new JediWindjammerDevice(device.Address, device.AdminPassword); _data = executionData.GetMetadata <JetAdvantageScanActivityData>(); _engine = new OxpdBrowserEngine(_device.ControlPanel); ScanOptions = scanOptions; }
/// <summary> /// Initializes a new instance of the <see cref="JediOmniBlueprintApp"/> class. /// </summary> /// <param name="device">The device.</param> public JediOmniBlueprintApp(JediOmniDevice device) : base(device.Snmp, device.ControlPanel) { _controlPanel = device.ControlPanel; _launchHelper = new JediOmniLaunchHelper(device); _masthead = new JediOmniMasthead(device); _engine = new OxpdBrowserEngine(device.ControlPanel); _idleTimeoutOffset = device.PowerManagement.GetInactivityTimeout().Subtract(TimeSpan.FromSeconds(10)); }
private const int _footerOffset = 50; // This is based on a 800 x 600 screen. If the screen is smaller, this value will likely need changing. /// <summary> /// Initializes a new instance of the <see cref="JediWindJammerHpcrApp"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="buttonTitle">The button title.</param> /// <param name="scanDestination">The scan destination.</param> /// <param name="scanDistribution">The scan distribution.</param> /// <param name="documentName">Name of the document.</param> /// <param name="imagePreview">Whether Image preview is on/off</param> public JediWindJammerHpcrApp(JediWindjammerDevice device, string buttonTitle, string scanDestination, string scanDistribution, string documentName, bool imagePreview) : base() { _buttonTitle = buttonTitle; _device = device; _controlPanel = device.ControlPanel; _documentName = documentName; _engine = new OxpdBrowserEngine(device.ControlPanel); _scanDestination = scanDestination; _scanDistribution = scanDistribution; _imagePreview = imagePreview; }
/// <summary> /// Initializes a new instance of the <see cref="JediOmniAutoStoreApp" /> class. /// </summary> /// <param name="device">The device.</param> /// <param name="appButtonTitle">The application button title.</param> /// <param name="documentName">Name of the document.</param> public JediOmniAutoStoreApp(JediOmniDevice device, string appButtonTitle, string documentName) : base() { ButtonTitle = appButtonTitle; DocumentName = documentName; _device = device; _controlPanel = device.ControlPanel; _masthead = new JediOmniMasthead(_device); _engine = new OxpdBrowserEngine(_device.ControlPanel, AutoStoreResource.AutoStoreJavaScript); _idleTimeoutOffset = device.PowerManagement.GetInactivityTimeout().Subtract(TimeSpan.FromSeconds(10)); ScreenWidth = _controlPanel.GetScreenSize().Width; }
private bool UseGeniusBytesPin() { OxpdBrowserEngine engine = new OxpdBrowserEngine(ControlPanel); for (int checkCount = 0; checkCount < 10; checkCount++) { if (engine.WaitForHtmlContains("Enter PIN", TimeSpan.FromSeconds(1))) { return(true); } else if (engine.WaitForHtmlContains("Username", TimeSpan.FromSeconds(1))) { return(false); } } return(false); }
/// <summary> /// Navigate to Jedi HPAC /// </summary> public void NavigateToJediHpac() { _engine = new OxpdBrowserEngine(_jediDevice.ControlPanel); try { _jediDevice.ControlPanel.PressToNavigate("43617065-6C6C-614D-4A20-110209495001", "SignInForm", true); // Thread.Sleep(_shortDelay); _jediDevice.ControlPanel.TypeOnVirtualKeyboard("mKeyboard", _credential.UserName.Substring(1)); //Thread.Sleep(_mediumDelay); _jediDevice.ControlPanel.PressToNavigate("Enter", "OxpUIAPPMainForm800X600", true); } catch (Exception ex) { ExecutionServices.SystemTrace.LogDebug( $"Navigation failed with exception: {ex.Message}"); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="JediOmniDssWorkflowApp" /> class. /// </summary> /// <param name="device">The device.</param> public JediOmniDssWorkflowApp(JediOmniDevice device) { if (device == null) { throw new ArgumentNullException(nameof(device)); } _device = device; _controlPanel = _device.ControlPanel; _masthead = new JediOmniMasthead(device); _launchHelper = new JediOmniLaunchHelper(device); _notificationPanel = new JediOmniNotificationPanel(device); _enhancedWorkflowApp = new DssEnhancedWorkflowApp(_controlPanel); _idleTimeoutOffset = device.PowerManagement.GetInactivityTimeout().Subtract(TimeSpan.FromSeconds(10)); _popupManager = new JediOmniPopupManager(device); _engine = new OxpdBrowserEngine(_device.ControlPanel, DssWorkflowResource.DssWorkflowJavaScript); Pacekeeper = new Pacekeeper(TimeSpan.Zero); }
private void EmailFormInput() { int offSet = OxpdBrowserEngine.GetBrowserOffset(_controlPanel); int emailPanelBottom = _engine.GetBottomLocationById("inputForm");//_engine.GetBoundingAreaById("inputForm").Bottom + offSet; // The to address is being set by the server. I'm just commenting this out // in case we decide to do something different... //SetTextboxValue("to", _emailToAddress); int screenOffset = 150; int bottomOffset = 100; if (_controlPanel.GetScreenSize().Width.Equals(480)) { screenOffset = 10; bottomOffset = 3; } int location = _engine.GetBottomLocationById("subject"); if (location > emailPanelBottom) { SwipeScreen(offSet + screenOffset, emailPanelBottom - bottomOffset); } SetTextboxValue("subject", "Scanning via AutoStore " + ExecutionOptions.AutoStoreWorkflow); location = _engine.GetBottomLocationById("message"); if (location > emailPanelBottom) { SwipeScreen(offSet + screenOffset, emailPanelBottom - bottomOffset); } SetTextboxValue("message", "User " + EmailToAddress + " is utilizing AutoStore Email."); location = _engine.GetBottomLocationById("filename"); if (location > emailPanelBottom) { SwipeScreen(offSet + screenOffset, emailPanelBottom - bottomOffset); } SetTextboxValue("filename", DocumentName); }
/// <summary> /// Initializes a new instance of the <see cref="JediWindjammerAutoStoreApp"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="appButtonTitle">The application button title.</param> /// <param name="documentName">Name of the document.</param> public JediWindjammerAutoStoreApp(JediWindjammerDevice device, string appButtonTitle, string documentName) : base() { ButtonTitle = appButtonTitle; DocumentName = documentName; _device = device; _controlPanel = device.ControlPanel; _engine = new OxpdBrowserEngine(_device.ControlPanel, AutoStoreResource.AutoStoreJavaScript); MoreOptionsBtnId = "HPOXPDMOREOPTIONS"; MoreOptionsDownArrowBtnId = "HPOXPDMOREOPTIONSPAGEDOWN"; MoreOptionsUpArrowBtnId = "HPOXPDMOREOPTIONSPAGEUP"; MoreOptionsImagePreview = "PreviewModeOption-button"; PreviewModeOffId = "HPOXPDDROPDOWNID#1OXPDID0"; PreviewModeOnId = "HPOXPDDROPDOWNID#1OXPDID1"; MoreOptionsJobBuild = "JobAssemblyModeOption-button"; JobBuildModeOffId = "HPOXPDDROPDOWNID#1OXPDID1"; JobBuildModeOnId = "HPOXPDDROPDOWNID#1OXPDID0"; }
/// <summary> /// Finds a valid element in the specified element list and presses it using the OxpdBrowserEngine. /// </summary> /// <param name="elementIds"></param> protected void PressElementOxpd(List <string> elementIds) { OxpdBrowserEngine engine = new OxpdBrowserEngine(ControlPanel); BoundingBox boundingBox = new BoundingBox(); for (int i = 0; i < elementIds.Count; i++) { try { boundingBox = engine.GetBoundingAreaById(elementIds[i]); break; // Found the element so stop iterating the list } catch (DeviceWorkflowException) { if (i == elementIds.Count - 1) { //If this is the last element, rethrow the exception throw; } } } engine.PressElementByBoundingArea(boundingBox); }
/// <summary> /// Initializes a new instance of the <see cref="JetAdvantageAppBase"/> class. /// </summary> /// <param name="controlPanel">The control panel.</param> protected JetAdvantageAppBase(IJavaScriptExecutor controlPanel) { Engine = new OxpdBrowserEngine(controlPanel); }
/// <summary> /// Initializes a new instance of the <see cref="SafeQAppBase" /> class. /// </summary> /// <param name="controlPanel"></param> protected SafeQAppBase(IJavaScriptExecutor controlPanel) { _engine = new OxpdBrowserEngine(controlPanel, SafeQResource.SafeQJavaScript); }
/// <summary> /// Initializes a new instance of the <see cref="UdocxScanAppBase" /> class. /// </summary> /// <param name="controlPanel"></param> protected UdocxScanAppBase(IJavaScriptExecutor controlPanel) { _engine = new OxpdBrowserEngine(controlPanel, UdocxScanResource.UdocxScanJavaScript); }
/// <summary> /// Initializes a new instance of the <see cref="SafeComUCAppBase" /> class /// </summary> /// <param name="snmp">The SNMP.</param> /// <param name="controlPanel">The control panel.</param> protected SafeComUCAppBase(Snmp snmp, IJavaScriptExecutor controlPanel) { _snmp = snmp; _engine = new OxpdBrowserEngine(controlPanel, SafeComUCResource.SafeComUCJavaScript); }
/// <summary> /// Initializes a new instance of the <see cref="PaperCutAgentlessAppBase" /> class. /// </summary> /// <param name="controlPanel">The control panel.</param> protected PaperCutAgentlessAppBase(IJavaScriptExecutor controlPanel) { _engine = new OxpdBrowserEngine(controlPanel, PaperCutAgentlessResource.PaperCutAgentlessJavaScript); }