Forum Discussion

AbilAjay's avatar
AbilAjay
Occasional Contributor
2 years ago
Solved

Any easiest way to get the parameters for TestObj.Picture(ClientX, ClientY, Width, Height, Mouse)

I want to capture pic for a particular area of the object while the test run, it is used to recognize the text in that particular area of the object

please tell me how to get these params

ClientX,

ClientY,

Width,

Height,

Mouse

The Main goal is I want to recognize the particular number in the highlighted area, in that picture

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/onscreen/picture-method-onscreen-object.html#example

 

  • I found a solution
    First we will find the coordinate of x and y using view object option this window will help to find the coordinates relative to the object and then you need to specify the hight and width of rectangle
    In script (python)
    picObj = Object.Picture(1012, 24, 1144, 24)
    NeededText = OCR.regonize(picObj).fullText

9 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Are you saying that Object Spy tool is not able to identify each of the UI objects? I'm not sure what your application is build in, but try adding the WndClass name to MSAA in your project settings, and TC might be able to identify each of the UI objects.

  • AbilAjay's avatar
    AbilAjay
    Occasional Contributor
    We can recognize by picture object but i don't know how to get the x ,y, height and width of the particular area of an object
  • AbilAjay's avatar
    AbilAjay
    Occasional Contributor
    Object Spy took full grind of the image it doesn't took that specific highlighted text area
  • AbilAjay's avatar
    AbilAjay
    Occasional Contributor
    I'm using OCR in lot of places in my testcase but the problem is OCR is always took all text inside of the object area but i want to specify the area of recognition how to specify the area?
  • AbilAjay's avatar
    AbilAjay
    Occasional Contributor
    I found a solution
    First we will find the coordinate of x and y using view object option this window will help to find the coordinates relative to the object and then you need to specify the hight and width of rectangle
    In script (python)
    picObj = Object.Picture(1012, 24, 1144, 24)
    NeededText = OCR.regonize(picObj).fullText