1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Unten ist mein Java-Code:
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();
}
und habe alle auf diesem und diesem Link vorgeschlagenen möglichen Lösungen ausprobiert, aber immer noch ohne Erfolg. Was soll ich im Koordinatenbereich einstellen? Standardmäßig ist es 18 und seine Koordinatenposition von der linken Seite des Fensters ist 1319 und von der rechten Seite des Fensters ist 252.
Ich habe ein Bild dieser Bildlaufleiste angehängt. Angenommen, ich möchte von 18 auf 17 ziehen. Wie kann ich das tun? Bitte hilf mir . Ich stecke fest.
