Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 硒化物拖放到某个偏移位置_Java_Drag And Drop_Selenide - Fatal编程技术网

Java 硒化物拖放到某个偏移位置

Java 硒化物拖放到某个偏移位置,java,drag-and-drop,selenide,Java,Drag And Drop,Selenide,是否可以在Selenide中的某个偏移位置执行拖放操作?我想将元素拖到页面的某个部分。不幸的是,我在其他页面上找不到答案,文档中也缺少答案。我想避免使用像“Action”类这样的selenium工具。它必须移动到offsetX和offsetY Actions dragAndDrop = new Actions(driver); dragAndDrop.dragAndDropBy(element, offsetX, offsetY).perform(); -> I want t

是否可以在Selenide中的某个偏移位置执行拖放操作?我想将元素拖到页面的某个部分。不幸的是,我在其他页面上找不到答案,文档中也缺少答案。我想避免使用像“Action”类这样的selenium工具。它必须移动到offsetX和offsetY

   Actions dragAndDrop = new Actions(driver); 
   dragAndDrop.dragAndDropBy(element, offsetX, offsetY).perform(); -> I want to replace it with some Selenide tool

尝试使用
Selenide.actions()
static方法

来自Selenide javadoc:

public static org.openqa.selenium.interactions.Actions() 使用此方法,您可以使用如AdvancedUserInteractions页面中所述的Selenium操作

   actions()
    .sendKeys($(By.name("rememberMe")), "John")
    .click($(#rememberMe"))
    .click($(byText("Login")))
    .build()
    .perform();