0

from and to is "buttons" in a slider to change the from and to time. I´m having problem how to move these buttons in webdriverio. Below is an example how i want to do it, but nothing happens.

let from = browser.element('#from');
let to = browser.element('#to');

var XCordinate = from.getLocation(); //gets current x position of from element
var yCordinate = from.getLocation(); //gets current y position of from element

from.moveToObject(XCordinate+20, yCordinate); //Move the element only in x 
jaikl
  • 971
  • 2
  • 9
  • 23

1 Answers1

1

Because moveToObject function just move your cursor to that cordinates, Not clicking there or taking any action on there.

You can use buttonDown,buttonUp and moveTo methods of webdriverio as below :

browser.buttonDown(button); 
browser.moveTo(element,xoffset,yoffset); 
browser.buttonUp(button);
sayhan
  • 1,168
  • 1
  • 16
  • 22