Object cannot be recognized again once it has been clicked
- 5 years ago
Hi Paola,
> I do know that the click action is being succesfull because I get the right coordinates.
a) Is there any chance that object is regenerated after click? If it is, then this may explain the error message, because your code does not search for the object before dragging but uses stored reference to it. And if the object is regenerated this invalidates the stored reference.
You may try to replace .Click() call with the .HoverMouse() one. This should return same coordinates but should not cause any object regeneration (if any);
b) Your code for drag seems to be incorrect. It uses absolute screen coordinates (e.g. Sys.Desktop.MouseX) while, as per documentation, the .Drag() method uses object-relative coordinates for drag start and not the final point but distance to drag for end. See method's description and code sample for more details.