ContributionsMost RecentMost LikesSolutionsDrag-and-drop object to another object TestComplete's built-in Drag action is designed to drag a specific Alias object from a given point to another point, but at a pixel offset (i.e. drag Alias....Button by X/Y pixels). While useful as a "jumping off point", this approach can be problematic for obvious reasons (Dynamic UIs, changing screen resolutions, inconsistent offsets) leading to brittle tests. Fortunately, TestComplete method parameters offer a high degree of customisation. By evaluating and utilising exposed properties like ScreenTop/ScreenLeft, we can create more robust and adaptable drag-and-drop actions. This allows us to instead dynamically reference the coordinates of a target object, or better still use exposed values in simple calculations, like figuring out the offset value for the Drag action. This Python script example calculates the offset using the common ScreenTop and ScreenLeft positions of both objects then passes the difference to the Drag action, allowing us to drag one given object to another given object with much more flexibility : def dragToObject(clientObj, targetObj): # Using ScreenLeft property to drag horizontally; ScreenTop for vertical fromObjectTop = aqObject.GetPropertyValue(clientObj, "ScreenTop") fromObjectLeft = aqObject.GetPropertyValue(clientObj, "ScreenLeft") toObjectTop = aqObject.GetPropertyValue(targetObj, "ScreenTop") toObjectLeft = aqObject.GetPropertyValue(targetObj, "ScreenLeft") dragY = toObjectTop-fromObjectTop dragX = toObjectLeft-fromObjectLeft Log.Message("Dragging "+aqConvert.IntToStr(dragX)+"px horizontally and"+aqConvert.IntToStr(dragY)+"px vertically") clientObj.Drag(-1, -1, dragX, dragY) You can then even utilise this in your KeywordTests, by changing the input parameter Mode to Onscreen Object, which enables the Object Picker : Now you have a way to drag one object to another - for example a value into a table? Hope this gets the creative juices going - can you think of other ways you might handle dynamic values in other Action methods? Regards, Mike TestComplete Solutions Engineer SE Tip : Drag-and-drop one object to another Hi all, A common challenge in automation is achieving precise drag-and-drop actions, especially when dealing with dynamic or responsive user interfaces. This question comes up regularly in different ways - how do I refine the drag-and-drop action in TestComplete? TestComplete's built-in Drag action is designed to drag a specific Alias object from a given point to another point, but at a pixel offset (i.e. drag Alias....Button by X/Y pixels). While useful as a "jumping off point", this approach can be problematic for obvious reasons (Dynamic UIs, changing screen resolutions, inconsistent offsets) leading to brittle tests. Fortunately, TestComplete method parameters offer a high degree of customisation. By evaluating and utilising exposed properties like ScreenTop/ScreenLeft, we can create more robust and adaptable drag-and-drop actions. This allows us to instead dynamically reference the coordinates of a target object, or better still use exposed values in simple calculations, like figuring out the offset value for the Drag action. This Python script example calculates the offset using the common ScreenTop and ScreenLeft positions of both objects then passes the difference to the Drag action, allowing us to drag one given object to another given object with much more flexibility : def dragToObject(clientObj, targetObj): # Using ScreenLeft property to drag horizontally; ScreenTop for vertical fromObjectTop = aqObject.GetPropertyValue(clientObj, "ScreenTop") fromObjectLeft = aqObject.GetPropertyValue(clientObj, "ScreenLeft") toObjectTop = aqObject.GetPropertyValue(targetObj, "ScreenTop") toObjectLeft = aqObject.GetPropertyValue(targetObj, "ScreenLeft") dragY = toObjectTop-fromObjectTop dragX = toObjectLeft-fromObjectLeft Log.Message("Dragging "+aqConvert.IntToStr(dragX)+"px horizontally and"+aqConvert.IntToStr(dragY)+"px vertically") clientObj.Drag(-1, -1, dragX, dragY) You can then even utilise this in your KeywordTests, by changing the input parameter Mode to Onscreen Object, which enables the Object Picker : Now you have a way to drag one object to another - for example a value into a table? Hope this gets the creative juices going - can you think of other ways you might handle dynamic values in other Action methods? Regards, Mike TestComplete Solutions Engineer Re: SE Tip : Drag-and-drop one object to another Very welcome! You could expand this in other ways, such as using a built-in object method like FindChildByXpath, which also returns an Object type from a given Xpath. Then you could use a similar script, passing in Xpath values instead of specific alias objects to do the same job. Re: Change words in old posts Knulli as Marsha_R says you should be able to edit/delete your old posts using the context menu Do you not have this option? DM me the details if you face an issue and ill see what we can do Re: Unable to connect to mobile devices on TestComplete via Bitbar Hi This error means you do not have a licence for automated testing. Reach out to your account rep to get a trial, or use the trial form at the BitBar homepage. Thanks Re: Mobile Web Tests with Safari browser Hi simonaferrara The general concept is that you would create TestComplete web tests locally on your Windows machine in whatever browser you wish, then run that same test on another browser using BitBar. There is no requirement for you to have a Mac or access to Safari as BitBar provides that capability. Take a look at this short video for a working example of exactly this scenario : https://smartbear.wistia.com/medias/5odeoa03kv Re: Object spy issue for a desktop application You can perform testing in VDI's, but TestComplete must be installed and accessed on the same machine as the application under test so it may access all application internals. Regards the Object Tree differences, it is impossible to comment without seeing at least a screenshot of the two instances. Re: Object spy issue for a desktop application Hi abishekhari007 I would check the scaling settings for the application under test and TestComplete are set to "Application". You can find this by right-clicking on each app launcher icon, click on Compatibility tab then "High DPI Settings". Make sure the High DPI scaling is set to Application. If this still does not work, I suggest sending a support ticket which, if an issue is found, can be escalated to the dev team to investigate. https://support.smartbear.com/testcomplete/message/ Thanks Re: Click doesn't work on Chrome popup Hi ddima What version of TestComplete are you using? The latest version should be able to handle this JS alert. If not, you can try using an image-based action or an OCR action to handle it. Re: Real mobile devices Hi ḥari - BitBar does not connect to Selenium Grid - BitBar is its own Grid/Device Cloud. TestComplete connects to BitBar to run tests on the BitBar device cloud. You can review this method to connect to another provider/Grid : If you use any other Selenium Grid provider