Forum Discussion
Thanks Alex,
But how do i calculate the coordinates using currentWindow and oSearchResult objects ?
Can you help me out here.
Ant the reason I'm using image recognition to click on this button is because 'Object Spy' is unable to identify this button. I don't get a red rectangle over this button( also some other buttons which are on the status bar of my desktop application).
I don't want to use coordinates to click on the button, which is why I chose to do it using image recognition.
Please let me know if I can go ahead with Roberts suggestion in this case.
I have attached the screenshot of the status bar having the red rectangle of 'Object Spy'.
Thanks in advance.
Hi,
> Please let me know if I can go ahead with Roberts suggestion in this case.
Robert's suggestion is the recommended way because it is more fast and more reliable.
Assuming that you are testing desktop application, you should go through the https://support.smartbear.com/testcomplete/docs/app-testing/desktop/index.html help section and check that all necessary steps are done for your application. If, according to https://support.smartbear.com/testcomplete/docs/app-testing/desktop/index.html and information from your developers, you think that some control should be recognized by TestComplete's Object Browser while it is not, you may contact Support via the https://support.smartbear.com/message/?prod=TestComplete form and ask them.
> But how do i calculate the coordinates using currentWindow and oSearchResult objects ?
Exact code will depend on whether coordinates of the oSearchResult object are relative to the screen or to the parent currentWindow object.
Assuming screen-related coordinates, the code might be just like this:
Sys.Desktop.Click(oSearchResult.Left + 3, oSearchResult.Top + 3) // 3 is some empirical shift to make click() to happen over the control
Assuming object-related coordinates, the code might be:
Sys.Desktop.Click(currentWindow.ScreenLeft + oSearchResult.Left + 3, currentWindow.ScreenTop + oSearchResult.Top + 3) // 3 is some empirical shift to make click() to happen
Related Content
- 12 months agoMW_Didata
- 7 months agomengbinhao
- 2 years agorkadali
Recent Discussions
- 35 minutes agoSvetaG