Alexandre Ntf
Alexandre Ntf

Reputation: 15

Clic and slide at the same time - Protractor

Hello the community !

I'm coding a test for e2e, and I would like to slide the right circle to the extreme left for testing the price tool on my website.

I would like to click and slide the slider at the same time (check on picture).

The problem is that for sliding, the mouse has to be on the slide during all the action with the click activate.

I would like to know how to do it with Protractor :)

Thank you !!! Price slider

Upvotes: 0

Views: 320

Answers (1)

demouser123
demouser123

Reputation: 4264

I have had one of these sliders in one of my projects, and I did it via simple drag and drop code. Here is the one that I used (thanks alecxe for this)

   var slider = element(by.id('slider'));

   browser.actions().dragAndDrop(
      slider,
      {x:100, y:0}
      ).perform();

where x,y are the coordinates to which I have to move the slider.

Upvotes: 1

Related Questions