Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
2 months ago
Solved

OCR service failed. request contains invalid argument

wanted to post this here before i open a case with smartbear.

a few weeks back i started noticing that some of my test cases were getting this OCR service failed error message when it was attempting to click on a tab object to select it. The details of the message are:

The OCR service failed to process the document.

Details:
Image dimension: 2364x23
Size: 2178 bytes
Hash: bedd9dc113a17fb2d4ba39c6a7bcc41e
Request execution time: 35250 ms
Server: https://ocr.api.dev.smartbear.com
Status code: 500 (Internal Server Error.)
Error message: Request contains an invalid argument

i can run this test case on my local workstation without any issue and if have run it on our automation VM successfully using the Network Suite. But when it runs on that same VM having been triggered by an Azure pipeline it takes this error (see attachment). 

at first i was using the OCR.Recognize in this manner 

OCR.Recognize(Aliases.NuPoint.frmContainer.MdiTabGroupControl).BlockByText("Teller").Click();

when that starting getting the error i developed a function that did the recognize on the whole tab structure,

  let objTabs = Aliases.NuPoint.frmContainer.MdiTabGroupControl;
  let objRecognizedText = OCR.Recognize(objTabs);

then i got the block count (number of tabs), initiated a for loop looking for the tab text "Teller" then clicked that block and did a break out of the for loop. 

as i said, worked great locally and on the VM via Network Suite but still fails on the VM pipeline when it encounters the OCR.Recognize statement.

  let objRecognizedText = OCR.Recognize(objTabs);

shown above with the "Request Contains an invalid argument"

Has anyone encountered this. my workstation and VM's are running the latest version/release of TestComplete/TestExecute. 

2 Replies

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    I don't have much experience using OCR on a pipeline run but I know enough to ask a few leading questions to start off the conversation. 

    1. Is this behavior consistent to a step, image or image size?
    2. Is your pipeline environment headless?  (this would likely make the behavior consistent to any OCR errors) 

    If this is inconsistent one thing to try is altering the waits/time-outs.  Azure sometimes takes longer to do things.

    There are others I have found but lets start here.

    ... If you find my posts helpful drop me a like! 👍 Be sure to mark or post the solution to help others out and/or to credit the one who helped you. 😎