Robotic Process Automation (RPA)

 View Only
  • 1.  Windows Controls: Software window cannot be accessed

    Posted Wed July 21, 2021 06:34 AM
    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 Thu July 22, 2021 07:44 AM

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



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

    Posted Sun August 08, 2021 02:35 PM
    Hello Antonio,

    thank you for your fast reply.

    The getControl command used to fix it temporarily. However, I used to have a meeting with another developer recently and we figured that this is still a minor bug with some software that it is impossible to attach/ get control. Hopefully, it works fine with the next software update soon.

    Cheers,

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



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

    Posted Tue August 17, 2021 09:05 AM
      |   view attached
    Hi Jan,

    I am new to using RPA, I am trying to attach a file on a web page and I am getting a similar alert when I click the attach button:

    WDG.Automation.Runtime.ControlNotFoundException: Control not found to Click on XPath=/html/body/div[2]/div/div[1]/div/main/div/div/div/div/div/div/div[2]/div[1]/div/div/div/div[1]/div[4]/div[2]/div/span/button en WDG.Automation.Browser.SeleniumInstance.Click(ClickRequest request) en WDG.Automation.Browser.BrowserInstance.WopfOH2J41(ClickRequest ) en WDG.Automation.Browser.BrowserInstance.YwtvHycgaWayB0irQYd.XnEuHGI40s() en WDG.Automation.Browser.BrowserInstance.XMdfYO61yl(Action ) en WDG.Automation.Browser.BrowserInstance.Click(ClickRequest request) en WDG.Automation.Browser.WebClickCommand.Execute(BrowserContext context)

    Can you tell me if it is possible to do what I need?
    I would appreciate your help.

    Regards.

    ------------------------------
    Anyer Hernández
    ------------------------------



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

    Posted Tue August 17, 2021 04:35 PM
    Hi Anyer,

    I answered you in your new thread :)

    Best regards

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