Forum Discussion
Coordinates are not the best way to look for an object since they can change between runs of the test or between machines or even between reloads of the same browser. Try using the object name instead. It's a more persistent value.
The drag function always requires the X,Y co-ordinates for the start position and the end position :/. But thank you anyways for your kind help!
- Marsha_R4 years agoChampion Level 3
What happens when you try to use the object again in the same function? The exact error message and/or a screenshot would be helpful.
- anapao4 years agoOccasional Contributor
Hi Marsha_R thanks again for your help! here the screenshot of Test Log . I double checked the search area and is the right one
Here the relevant part of the code:
ImageRepository.AssetLibraryMenus.Menu_ExternalEnergyNetworks.Click()
MySourceObject = ImageRepository.Assets.ElectricGridConnection
ImageRepository.Assets.ElectricGridConnection.Click()
X = Sys.Desktop.MouseX
Y = Sys.Desktop.MouseY
MyDestinationObject = Aliases.SimpsonGui.ComponentTreeView.qt_scrollarea_viewport
MyDestinationObject.Click()
toX = Sys.Desktop.MouseX
toY = Sys.Desktop.MouseY
Log.Message(X)
Log.Message(Y)
Log.Message(toX)
Log.Message(toY)
MySourceObject.Drag(X,Y,toX,toY)
Related Content
- 2 months agoNicolaFilosa_SE
- 5 years agoAurore