Robotic Process Automation

  • 1.  Attach file on a web page

    Posted Tue August 17, 2021 09:07 AM
      |   view attached
    Hi,
    Nice to greet you.

    Currently, I am starting out in this world of process automation with RPA. I have seen the introductory courses of the tool and I am now trying to automate a basic process that we have in the organization.

    I have a script that should do the following:
    1. Go to a web page.
    2. Run a filter to get a report.
    3. Download the report to my computer.
    4. Manipulate the report generated in excel.
    5. Attach it to a web page.

    This last step I cannot do.
    The process runs complete and does not give an error.

    Just leave an alert with the following information:

    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)

    Unable to click explore button, image attached.


    Can you help me? what is the best way to do this i need?

    Beforehand thank you very much!
    Regards.


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


  • 2.  RE: Attach file on a web page

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

    happy to hear that you found your way into the RPA world.

    Could you send the Script Code of the last part where the error occurs? This might give more clues.
    I suppose it might be because you do not have the website properly attached, especially because you were working with Excel and the image before. Try to add the step before to attach the specific Browser tab.
    If that does not work try to use the command "Get Control" before the command which leads to the error. Another developer once gave me this hint and it worked.

    Besides, I would recommend to use ID as an identifier within the command if this is possible. That is mostly more reliable than XPATH from my experience.

    Best of luck

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



  • 3.  RE: Attach file on a web page

    Posted Wed August 18, 2021 02:51 AM
    Hi Jan,
    Thanks for answering.

    The line that generates the error in the script is this:
    webClick --selector "XPath" --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"

    I have added the command that you indicate:
    getControl --selector "XPath" --forcerefresh --xpath "/html/body/div[1]/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"

    And it gives the following error:

    WDG.Automation.Windows.WindowNotAttachedException: Se produjo una excepción de tipo 'WDG.Automation.Windows.WindowNotAttachedException'.
    en WDG.Automation.Windows.BaseWindowControlCommand.EnsureWindow(WindowsContext context)
    en WDG.Automation.Windows.GetControlCommand.ExecuteCore(WindowsContext context)
    --- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
    en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    en WDG.Automation.Language.ErrorHandler.lUFtgfS6B3UXYO8FnHA(Object )
    en WDG.Automation.Language.ErrorHandler.mGnpEI0m8x(Exception )
    en WDG.Automation.Language.ErrorHandler.HandleExecutionExceptionIfNeeded(Exception exception, IAutomationCommand command)
    en WDG.Automation.Language.CommandInterpreter.<Run>d__12.BjWVfHiEeDw1YyIIoxS(Object , Object , Object )
    en WDG.Automation.Language.CommandInterpreter.<Run>d__12.MoveNext()
    --- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
    en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    en WDG.Automation.Language.ScriptInterpreter.<RunCore>d__17.MoveNe

    I do it with XPATH because it has worked for me in the previous steps before getting to this last one. With ID and Class it doesn't work.

    I remain attentive to your comments.
    Regards.




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



  • 4.  RE: Attach file on a web page

    Posted Wed August 18, 2021 03:49 AM
    Could you send more of the Script Code before the error occurs? Does it work to click on other buttons on the website opened?

    Another spontaneous idea which might help fix the problem: Try turning the option "Simulate Human" on in the webClick command.

    The last possibility I would suggest is to use "Enter Keys' command and to go through the webpage by using {TAB}s and {ENTER} when the desired Explore Button is focused.

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



  • 5.  RE: Attach file on a web page

    Posted Wed August 18, 2021 04:15 AM
    Hi Jan,

    I attach the whole script:

    webStart --name TWIQ --type "Chrome"
    webNavigate --url "https://xxxxxxx.com/jira"
    webSet --value xxxxx --selector "Name" --name os_username
    webSet --value "${Clave}" --selector "Name" --name os_password
    webClick --selector "IdAndName" --id login --name login
    webWait --timeout "00:00:10"
    webNavigate --url "https://xxxxxxx.com/jira/secure/Tempo.jspa#/reports/logged-time?columns=WORKED_COLUMN&dateDisplayType=days&filterId=100000&from=2021-06-01&groupBy=project&groupBy=worker&groupBy=worklog&periodType=CURRENT_PERIOD&subPeriodType=MONTH&to=2021-06-30&viewType=TIMESHEET"
    webWait --timeout "00:00:10"
    webClick --selector "XPath" --xpath "/html/body/div[1]/div/div/div/div/div[2]/div/div[2]/div[3]/button"
    webWaitElement --selector "XPath" --xpath "/html/body/div[1]/div/div/div/div/div[2]/div/div[2]/div[3]/button"
    webClick --selector "XPath" --xpath "/html/body/div[1]/div/div/div/div/div[2]/div/div[2]/div[3]/div/section/div[2]/article[4]/div"
    webWaitDownload --saveto "C:\\Users\\ahernandez\\Desktop\\IBM" --nametosave PruebaInlogiqAnyer --extension xls File=filename
    webNavigate --url "https://xxxxxxxx/jira/projects/XXXX/issues/XXXXXX-11"
    webWait --timeout "00:00:10"
    webClick --selector "XPath" --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"--simulatehuman
    getControl --selector "XPath" --forcerefresh --xpath "/html/body/div[1]/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"

    If it works, click on other buttons on the website.

    When I click Explorar, it should open a window to browse the documents on my computer and allow me to search for the report to attach. I really don't know if this is the best practice, is there any other way to do it?

    Can you give me an example of how the "Enter Keys" command works.

    I remain attentive to your comments.
    Regards.

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



  • 6.  RE: Attach file on a web page

    Posted Sat August 21, 2021 11:22 AM
    Hi Anyer,

    I remember that other developers also had some issues automating Jira. So it does not seem like it's your mistake. As said before, a possible fix would be by using the "Send Keys" or "Web Send Keys" command. Another possible solution would be to attach the browser window like a normal window and then click on the button via image recognition.
    Try those options and if it still does not work or you need any help, you can contact me directly and we can set up a quick 15-min meeting and I can have an in-depth look. (And post the solution in this thread afterwards to help other developers who might encounter this issue in the future).

    Have a good weekend!

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



  • 7.  RE: Attach file on a web page

    Posted Thu August 26, 2021 05:41 AM
    Update: we fixed the issue by applying the "Send Keys" command and using {TAB} and {ENTER} to navigate with that command.

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



  • 8.  RE: Attach file on a web page

    Posted Fri August 27, 2021 03:19 AM
    Hi Jan,
    Thanks for the help.

    We have already been able to attach the report to the Jira task.

    I leave you the complete code:

    webStart --name TWIQ --type "Chrome"
    webNavigate --url "https://xxxxxxx.com/jira"
    webSet --value xxxxx --selector "Name" --name os_username
    webSet --value "${Clave}" --selector "Name" --name os_password
    webClick --selector "IdAndName" --id login --name login
    webWait --timeout "00:00:10"
    webNavigate --url "https://xxxxxxx.com/jira/secure/Tempo.jspa#/reports/logged-time?columns=WORKED_COLUMN&dateDisplayType=days&filterId=100000&from=2021-06-01&groupBy=project&groupBy=worker&groupBy=worklog&periodType=CURRENT_PERIOD&subPeriodType=MONTH&to=2021-06-30&viewType=TIMESHEET"
    webWait --timeout "00:00:10"
    webClick --selector "XPath" --xpath "/html/body/div[1]/div/div/div/div/div[2]/div/div[2]/div[3]/button"
    webWaitElement --selector "XPath" --xpath "/html/body/div[1]/div/div/div/div/div[2]/div/div[2]/div[3]/button"
    webClick --selector "XPath" --xpath "/html/body/div[1]/div/div/div/div/div[2]/div/div[2]/div[3]/div/section/div[2]/article[4]/div"
    webWaitDownload --saveto "C:\\Users\\ahernandez\\Desktop\\IBM" --nametosave xxxxxxxx --extension xls File=filename
    webNavigate --url "https://xxxxxxxx/jira/browse/XXXXXXX-11"
    webWait --timeout "00:00:10"
    delay --timeout "00:00:05"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{ENTER}"
    setClipboard --text "C:\\Users\\ahernandez\\Desktop\\IBM\\xxxxxxxxx.xls" --mode "Text"
    delay --timeout "00:00:05"
    paste
    sendKeys --keys "{TAB}"
    sendKeys --keys "{TAB}"
    sendKeys --keys "{ENTER}"

    Regards.

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