Skip to content

Commit

Permalink
Merge pull request #2376 from GeorgeLBS1/fix/doubleClick
Browse files Browse the repository at this point in the history
Fix: Resolves #2259 doubleClick and rightClick issue
  • Loading branch information
ptrthomas authored Aug 5, 2023
2 parents 7e1f3b3 + 7ee8b8b commit 68028d2
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions karate-robot/src/main/java/com/intuit/karate/robot/RobotBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public Robot click() {

@Override
public Robot rightClick() {
return click(3);
return click(2);
}

@Override
Expand All @@ -299,9 +299,20 @@ public Robot click(int num) {

@Override
public Robot doubleClick() {
click();
delay(40);
click();
if (highlight) {
getLocation().highlight(highlightDuration);
int toDelay = highlightDuration;
if (toDelay > 0) {
RobotUtils.delay(toDelay);
}
}
int clickType = mask(1);
robot.mousePress(clickType);
robot.mouseRelease(clickType);
RobotUtils.delay(100);
robot.mousePress(clickType);
robot.mouseRelease(clickType);

return this;
}

Expand Down

0 comments on commit 68028d2

Please sign in to comment.