Robotic Process Automation (RPA)

 View Only
  • 1.  OCR issues

    Posted Mon December 12, 2022 09:52 AM
      |   view attached
    hello all ,
    I have a problem using "OCR" command with returning error message

    Error executing command at line 19: ocrClick --safesearch --ocrprovider "Abbyy" --comparison "Contains" --segmentation "Word" --text "Sign in" --occurrencetype "Last" --language "en-US" --selector "XPath" --xpath "/root/document[1]/button[1]"
    Exception of type 'WDG.Automation.Windows.WindowNotAttachedException' was thrown.

    Can anyone please help me to kill this issues
    Best Regard,
    Abdelgwad

    ------------------------------
    abdelgawad elsayed
    ------------------------------


  • 2.  RE: OCR issues

    IBM Champion
    Posted Mon December 12, 2022 11:46 AM
    Hey Abdelgawad,

    Be sure to attach to the window you are planning to utilize the OCR click on first.  For example, this can be done through the "Launch and Attach" or the "Find Window" commands.

    The below sample script can be found on the OCR Click documentation
    defVar --name paintWindow --type Window
    defVar --name paintImage --type Image
    defVar --name clickedText --type String
    defVar --name success --type Boolean
    defVar --name clickRegion --type Rectangle
    // Opens the Paint executable.
    launchWindow --executablepath "C:\\Windows\\System32\\mspaint.exe" paintWindow=value
    // Extracts the text contained in the informed control, using the Google Cloud Vision OCR provider.
    ocrClick --ocrprovider "GoogleVision" --comparison "Contains" --segmentation "Word" --text View --occurrencetype "First" --language "eng" --region "5,3,42,20" --selector "Name" --name View success=success paintImage=image clickedText=text clickRegion=bounds
    logMessage --message "Success: ${success}\r\nClicked Text: ${clickedText}\r\nClick Region: ${clickRegion}" --type "Info"
    closeWindow --window ${paintWindow}
    // The return varies according to the current execution context. In the case of this example:
    // Success: True
    // Clicked Text: View
    // Click Region: 8,5,20,9


    ------------------------------
    Martin Medina
    Salient Process
    ------------------------------



  • 3.  RE: OCR issues

    Posted Sun December 18, 2022 05:29 AM
    hello Martin,

    I tried this solution with a web application but it still didn't work, same error still appeared
    -------------------
    thanks
    Abdelgawad
    -------------------

    ------------------------------
    abdelgawad elsayed
    ------------------------------