pallavi khare
pallavi khare

Reputation: 21

How to pause between action in protractor?

I want to pause between performing mouse-down and mouse-move action. In my functionality i need to hold mouse down for 500ms and then move, is there any option to pause for 500ms after mousedown event and then move. I already applied browser.sleep()

Upvotes: 2

Views: 1431

Answers (1)

Nicholas Boll
Nicholas Boll

Reputation: 865

I had the same problem. Here is how I solved it (not the cleanest, but not sure how else):

CoffeeScript:

browser.actions().mouseDown($('#someElement')).perform().then (element) ->
  browser.sleep(500).then ->
    browser.actions().mouseMove($('body')).perform()

Note actions() and perform() are used twice - mouseDown(), mouseMove() and mouseUp() are only exposed through WebDriver.ActionSequence

Upvotes: 1

Related Questions