Forum Discussion
- lsainsburyContributorIn my experience it has done it automatically, it may seem like it is capturing the coordinates, but if you move the object to a different place or resize it before you run the test again, it should still work.
- listensrikanthOccasional ContributorThanks for the suggestion. In some cases, if i resize the window and run the test, test fails.
- lsainsburyContributorOkay, what is it that is making it fail?
- listensrikanthOccasional Contributorwhen i resize the window, it is looking for the co-ordinates in the scripts and dragging the cursor to same co-ordinates.
- lsainsburyContributorAre you performing the tests on a Desktop application?
Does this happen with all of your objects or just some of them?
Are you sure TestComplete is mapping the object correctly?
The only time I have trouble with TestComplete tracking windows is because we use TdxBarControl for our menus and they are not compiled with the debug information. - RavikSuper Contributor
You might be using "Record Low Level Procedure" mode while recording your script.
Try Normal Recording.
or
In case your objects are moving or height, width or position changing frequently at that time you will prefer Descriptive Programming. (Descriptive programming u need to create manually its time consuming process but most powerful and beneficial in your case )
Thanks
Ravik - listensrikanthOccasional ContributorYes, it is desktop application. Couldn't find the object, when i reduce the application size. Test was recorded in full size mode.
- listensrikanthOccasional ContributorWill try normal recording.
thanks - balathavamaniOccasional ContributorHi venkata yadlapalli,
Hope this might helpfull for you . Check and revert back.
1. Store the object name in a variable (Get object name via object spy)
var a =(Sys["Process"]("Testedapp")["Object"]("HwndSource: Window", "Window"));
2. By using Regions in Testcomplete we can save the image
Regions["AddPicture"](a, "Image");
Thanks
Bala Thavamani
- vjecovOccasional Contributor
How about next object, how would you write it in a Descriptive way?
var myButton = AddTheDescriptiveObjectWithPropertiesAndValues;
Next are object's properties and values (I don't want to use the mapped object):
FullName: Sys.Process("calc").Window("CalcFrame", "Calculator", 1).Window("CalcFrame", "", 1).Window("#32770", "", 2).Window("Button", "", 11);
Name: Window("Button", "", 11)
RecordClass: Button
WndClass: Button
Index: 11
I am looking for something like this:
var calcWindow = (Sys["Process"]("calc")["Window"]("CalcFrame:Calculator", 1)["Window"]("CalcFrame:", 1)["Window"]("#32770:", 2); var myBtn = calcWindow.["Window"]("RecordClass:Button", "WndClass:Button", "Name:Window(\"Button\", \"\", + caption)", "Index:11"); myBtn.ClickButton();
I know something is wrong in the code above but cannot figure it out, please help.