Selenide拖放到某个偏移位置

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

   actions dragAndDrop = new actions(driver); 
   dragAndDrop.dragAndDropBy(element,offsetX,offsetY).perform(); -> I want to replace it with some Selenide tool
ksgshot 回答:Selenide拖放到某个偏移位置

尝试使用Selenide.actions()静态方法。

来自Selenide javadoc:

  

公共静态org.openqa.selenium.interactions.Actions actions()   通过这种方法,您可以像AdvancedUserInteractions页面中所述使用Selenium Actions。

   actions()
    .sendKeys($(By.name("rememberMe")),"John")
    .click($(#rememberMe"))
    .click($(byText("Login")))
    .build()
    .perform();
本文链接:https://www.f2er.com/3151413.html

大家都在问