Robotic Process Automation

Expand all | Collapse all

Windows Controls: Software window cannot be accessed

  • 1.  Windows Controls: Software window cannot be accessed

    Posted 3 days ago
    Hey everyone,

    I am having an issue with a software I have to automate. 

    The first issue is that I cannot launch the software with the command "Launch and Attach Window". It finds the .exe, but the software only starts via a link (.lnk). That is because the .lnk has multiple targets: "C:\Software\Dyalogrt.exe" "C:\Software\TCWM999.DWS" inifile="HKEY_LOCAL_MACHINE\Software\Dyadic\CGMutb"
    I managed to fix that by using a Powershell command in IBM RPA. Otherwise I can also open it by an .exe I created that only opens the .lnk.
    I am mentioning this because it might be part of the following issue?

    Even though the window can be attached after using the "Find Window" command, the robot cannot control the window in any way. This error message down below pops up constantly. The code so far is simple and only 15 lines as this problem occurs straight at the beginning. I have tried it with different selectors and different alternatives to launch/attach the window and nothing works so far.


    WDG.Automation.Runtime.ControlNotFoundException: Control not found to TryGetControl on Id=80

       at WDG.Automation.Windows.BaseWindowControlCommand.TryGetControl(WindowsContext context, Boolean forceRefresh)

       at WDG.Automation.Windows.RefresheableWindowControlCommand.TryGetControl(WindowsContext context)

       at WDG.Automation.Windows.SetValueCommand.ExecuteCore(WindowsContext context)

    --- End of stack trace from previous location where exception was thrown ---

       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

       at WDG.Automation.Language.ErrorHandler.lUFtgfS6B3UXYO8FnHA(Object )

       at WDG.Automation.Language.ErrorHandler.mGnpEI0m8x(Exception  )

       at WDG.Automation.Language.ErrorHandler.HandleExecutionExceptionIfNeeded(Exception exception, IAutomationCommand command)

       at WDG.Automation.Language.CommandInterpreter.<Run>d__12.BjWVfHiEeDw1YyIIoxS(Object , Object , Object )

       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()



    Thanks a lot for your help!

    ------------------------------
    Jan Lorenz
    ------------------------------


  • 2.  RE: Windows Controls: Software window cannot be accessed

    Posted 2 days ago

    Hello, Jan!

    Attaching a Window to the script context (by using, as in your case, Launch and Attach Window) can store in the current context the Process Id of your executable if you provide a variable in the Process output parameter. This action attaches the process that you called by providing the path for the exe.
    In this case, I understand that you noticed this and used the findWindow command to find the desired application, storing it in a Window variable.

    In order to have the right executable in the current context, I would suggest you try to attach this window to the script (using attachWindow command). Use the debugger, put some breakpoint in your script and check the Globals panel while debugging to see if the script manages to attach your application.

    After that, getControl command should try to find the control in the attached window.

    Hope it helps you.



    ------------------------------
    Antonio Campos Junior-WDG
    ------------------------------