Forum Discussion

Jayanthsunkari's avatar
Jayanthsunkari
Occasional Contributor
6 years ago
Solved

How to Add OCR Step into existing script

Hello team,

 

I am working on mobile automation with  Testcomplete Image based process, now i want to include OCR step into existing script , could you please help me on adding OCR step into existing test

 

 

Case "Enter Text"
If(Typeofcall="Web") Then
if (InStr(1,strImageName,"OCR" ,1)>0) then
'OCR.Recognize Aliases.Device.Process_carrier_myinfinity.RootLayout.View_NO_ID.BlockByText strImageName.Touch
OCR.Recognize Aliases.Device.Process("air.com.carrier.myinfinity").View_NO_ID.BlockByText strImageName.Touch - i see error in this line 
if ((strImageName = "Username")or (strImageName = "Password")) Then
call oList.Touch()
'Mobile.Device.Keys()
'Mobile.Device.PressBack
Mobile.Device().Keys("")
Mobile.Device().Keys(stepdata)
Mobile.Device.PressBack
PerformStep="Text Entered"

 

 

 

  • i found solution for this issue , Thanks.

     

    there is syntex error when we converted keyword test into script 

     

    Below is the right syntex for the same.

     

    OCR.Recognize (Aliases.Device.Process_carrier_myinfinity.RootLayout.View_NO_ID).BlockByText("demo").Touch

1 Reply

  • Jayanthsunkari's avatar
    Jayanthsunkari
    Occasional Contributor

    i found solution for this issue , Thanks.

     

    there is syntex error when we converted keyword test into script 

     

    Below is the right syntex for the same.

     

    OCR.Recognize (Aliases.Device.Process_carrier_myinfinity.RootLayout.View_NO_ID).BlockByText("demo").Touch