Skip to content

Instantly share code, notes, and snippets.

@jimevans
Created November 30, 2021 15:31
Show Gist options
  • Save jimevans/7e43f8681b097df5445f1235b40b287e to your computer and use it in GitHub Desktop.
Save jimevans/7e43f8681b097df5445f1235b40b287e to your computer and use it in GitHub Desktop.
// Assume driver and element are properly defined and assigned elsewhere.
PointerInputDevice mouse = new PointerInputDevice();
ActionBuilder builder = new ActionBuilder();
builder.AddActions(
mouse.CreatePointerMove(element, 0, 0, TimeSpan.FromMilliseconds(100),
mouse.CreatePointerDown(MouseButton.Left),
mouse.CreatePointerMove(element, 100, 100, TimeSpan.FromMilliseconds(100),
mouse.CreatePointerUp(MouseButton.Left)
);
((IActionExecutor)driver).PerformActions(builder.ToActionSequence());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment