Forum Discussion

sanjayram's avatar
sanjayram
Contributor
10 months ago

Need code expression for click right (CLICKR)

Hi, 

        While using OCR action for test script, i can't able to perform clickR operation in testcomplete because i need to clickR below the recognized text, Need Need code expression for click right (CLICKR) ? 

 

  • HI Sanjayram,

                           U can click two ways.

    1 ocr.Recognize("Your object").BlockByText(m_BlockTxt, m_Position).ClickR

    2.

    OCR.RecognizeText("Image", "English", OCRSpeed.Fast);
    let ocrResult = OCR.GetRecognizedText("Image");
    let recognizedText = ocrResult.Text;
    let textPosition = ocrResult.Position;
    let xOffset = 10;
    let yOffset = 10;

    let mousePositionX = textPosition.X + xOffset;
    let mousePositionY = textPosition.Y + textPosition.Height + yOffset;
    aqObject.MouseClick(mousePositionX, mousePositionY, MouseButton.RightButton);

     

    u can change the posotion xOffset = 20,30,40.....etc