Код: Выделить всё
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Код: Выделить всё
WebElement sliderLocation = driver.findElement(By.xpath("(//*[@id='64']//following::canvas)[2]"));
// Used points class to get x and y coordinates of element.
Point classname = sliderLocation.getLocation();
int xcordi = classname.getX();
int ycordi = classname.getY();
int width = sliderLocation.getSize().getWidth();
System.out.println(
"Element's Position from left side of window " + xcordi + "and from right side of Window " + ycordi);
try {
Thread.sleep(3000);
Actions move = new Actions(driver);
Action action1 = (Action) move.dragAndDropBy(sliderLocation, 60, 0).build();
action1.perform();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Я прикрепил изображение этой полосы прокрутки. Предположим, я хочу перетащить с 18 на 17, как мне это сделать? Пожалуйста, помогите мне . Я сильно застрял.

Подробнее здесь: https://stackoverflow.com/questions/436 ... enium-java