Forum Discussion
12 Replies
Sort By
- tristaanogreEsteemed ContributorUnless your application is not recognized as an "open" application, the best practice is to avoid using X,Y co-ordinate designations when calling "Click" commands. If the Click method is called without co-ordinates, TestComplete will automatically click in the center of the indicated object.
So, instead of callingAliases.MyApp.MyForm.MyButton.Click(10,20)
simply callAliases.MyApp.MyForm.MyButton.Click()
- vthomeschoolmomSuper ContributorWhat Robert advises is accurate to a point. For a button, you can just issue a click. Click will click on the center of the object. If you were clicking on some other object, though, issuing a click in the center of the object is not always what you are going for. What technology is your application under test?
- ccwhite71Occasional ContributorMy application is a flow chart graphing tool. I am dragging shapes from one pane into a second pane and then connecting with lines. Test complete does not recognize the different objects in the panes. So the click in the center route will not work.
I have been looking and trying to figure out another way of doing this besides the x,y - ccwhite71Occasional ContributorAre the mouse coordinates relative to the pane or the entire desktop?
- tristaanogreEsteemed ContributorI believe they are relative to the object being clicked. So, if I have a window that's 300x500 pixels, I can click at 150, 250 and click in the center of that panel.
- joffreRegular ContributorI have made some tests before and the coordinates are about the object that is being clicked.
@Robert,
Wouldn't it be better if he clicks on button by calling the method "ClickButton"? As this example of mine script:FrmAdmin.frmConexao.btnConfigurar.ClickButton
- tristaanogreEsteemed Contributorjoffre
You are correct... a button would work best using ClickButton so long as TestComplete recognizes the component as a button component.
In this case, as I understand it, it sounds like what is being manipulated is some sort of imaged region where the individual child objects within the region are not recognized by TestComplete and so clicking on those objects is seen as clicking somewhere within the region. - gentleseaFrequent ContributorI usually use component-depending parameters. You can use the attributes .width and .height to place points resolution independant (in the middle e.g.):
// select first 3 points
viewVIEW.Click((1 * viewVIEW.width / 7), (viewVIEW.height / 2));
viewVIEW.Click((2 * viewVIEW.width / 7), (viewVIEW.height / 2));
viewVIEW.Click((3 * viewVIEW.width / 7), (viewVIEW.height / 2));
Cheers - ccwhite71Occasional Contributor@RobertMartin - You have it correct. Test complete is not recognizing the objects that I select, so it records the actions as mouse x,y clicks
- joffreRegular Contributor@Chris,
Maybe, instead of using coordinates, you can use the ".Keys("[Enter]")" or ".Keys(" ")". The second is the same as pressing the Space Bar on a Button. Check if it works. I don't like to use coordinates for nothing... ^^
Related Content
- 6 years agokaivi
- 5 years agolingling_chiang
- 13 years agotbom
Recent Discussions
- 3 hours agoSubhraDas