Ask a Question

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

SOLVED
AbilAjay
Occasional Contributor

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

AbilAjay_0-1671702740896.png

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/onscreen/picture-meth...

 

9 REPLIES 9
rraghvani
Trusted Contributor

Are you not able to use Object Spy tool?

AbilAjay
Occasional Contributor

Object Spy took full grind of the image it doesn't took that specific highlighted text area
rraghvani
Trusted Contributor

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
Occasional Contributor

I can't, It's build with Delphi
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
rraghvani
Trusted Contributor

Have you read through Testing Delphi Applications ? If yes, and you have not found a solution, then try using Optical Character Recognition or Image-Based Testing

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?
rraghvani
Trusted Contributor

Did you see my reference to Image-Based Testing?

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
cancel
Showing results for 
Search instead for 
Did you mean: