MarketSquare / MarketSquare/robotframework-SikuliLibrary
Keyword to drag from specific location to another location
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 163
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice to have a keyword that could be used to drag from specific point to another specific point. In order it to be more robust, it should use reference image as an origo. So something like this:
@RobotKeyword("Drag from source point to offset point using refImg as origo.")
@ArgumentNames({"xSrc", "ySrc", "xOffset", "yOffset", "refImg"})
public void dragAndDropByLocation(int xSrc, int ySrc, int xOffset, int yOffset, String refImg) throws Exception {
int result = 0;
Match match = wait(refImg, Double.toString(this.timeout));
Location origo = match.getCenter();
Location srcLocation = new Location(origo + xSrc, origo + ySrc);
Location newLocation = new Location(origo + xSrc + xOffset, origo + ySrc + yOffset);
result = screen.dragDrop(srcLocation, newLocation);
if (result==0) {
capture();
throw new ScreenOperationException("Failed to drag "+srcLocation +" to " +newLocation);
}
}
I have not written Java in more than a decade, so no idea whether that works :) I hope the idea get through.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing Java keywords for drag-and-drop, image matching, locations, and screen operations in the repository. Compare their argument and error-handling conventions, then define the new keyword's expected reference-image origin and verify that dragging from the source point to the offset destination works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop-dev, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100