Robotic Process Automation (RPA)

 View Only
  • 1.  Error using Click on Menu command

    Posted Wed April 05, 2023 03:48 PM
    Edited by Kristen Park Wed April 05, 2023 03:54 PM

    Hello, 

    In my RPA Bot, running the Click on Menu command outputs the error below. What is odd is that the command clicks through the menu and executes perfectly, but this error stops the execution from running further.

    System.Windows.Automation.ElementNotAvailableException: Element not available ---> System.Runtime.InteropServices.COMException: An event was unable to invoke any of the subscribers (Exception from HRESULT: 0x80040201)
       at UIAutomationClient.IUIAutomationElement.GetCurrentPropertyValueEx(Int32 propertyId, Int32 ignoreDefaultValue)
       at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property, Boolean ignoreDefaultValue)
       --- End of inner exception stack trace ---
       at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property, Boolean ignoreDefaultValue)
       at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property)
       at System.Windows.Automation.AutomationElement.GetPropertyValue(AutomationProperty property, Boolean cached)
       at System.Windows.Automation.AutomationElement.AutomationElementInformation.get_ControlType()
       at WDG.Automation.Runtime.Windows.Win32ControlFactory.BuildCore(IntPtr windowHandle, AutomationElement instance, String innerId)
       at WDG.Automation.Runtime.Windows.White.WhiteMenuBar.GetControl(String[] captions, Boolean clickOnLastItem, CancellationTimeout cancellationTimeout)
       at WDG.Automation.Windows.ClickOnMenuCommand.ExecuteCore(WindowsContext context)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at WDG.Automation.Language.CommandInterpreter.<Run>d__12.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at WDG.Automation.Language.ScriptInterpreter.<RunCore>d__17.MoveNext()




    ------------------------------
    Jesus Najera
    ------------------------------



  • 2.  RE: Error using Click on Menu command

    IBM Champion
    Posted Thu April 06, 2023 11:12 AM

    Hi Jesus,

    If the click is being sent to the application correctly, I suggest you open a support ticket with IBM to investigate this issue further.
    What you could do right now to avoid being blocked by this is put this command inside a Sub, so you can ignore the error that is happening. Inside the Sub, place an "On Error" command just before the "Click on Menu" command. Keep in mind that this will suppress any errors that might happen inside the Sub, so you might be better off using regular "Click" commands in case they work correctly and don't raise any wrong errors.



    ------------------------------
    Vinicius Marques
    ------------------------------