Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slider testing using protractor

Very new to protractor, and trying to test a slider using protractor. I found:

ptor.actions().dragAndDrop(slider.find(), {x:100, y:0}).perform()

should do the work. But its not helping in my code, can some one suggest something here?

The HTML code snippet:

<input ng-model="sliderValue" type="text" id="slider" slider="" options="sliderOptions" class="ng-pristine ng-untouched ng-valid ng-isolate-scope ng-hide" value="60">

<div class="jslider-pointer" style="left: 100%; background-color: rgb(3, 155, 229);"></div>
like image 290
user3482804 Avatar asked Mar 18 '23 02:03

user3482804


1 Answers

You should pass an element you found to dragAndDrop():

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

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

See other examples here:

  • Drag and drop using protractor in dthmlx component
  • How to simulate a drag and drop action in protractor?
like image 79
alecxe Avatar answered Mar 25 '23 08:03

alecxe