Why drag and drop is not working in Selenium Webdriver?

后端 未结 12 1807
借酒劲吻你
借酒劲吻你 2021-01-11 11:45

I am trying to drag an element into another element using Selenium WebDriver but it\'s not working. I tried all the solutions which I can find on internet but none of the so

12条回答
  •  猫巷女王i
    2021-01-11 12:09

    Actions act = new Actions(driver);
    WebElement source = driver.findElement(By.id("XXX"));
    WebElement destination = driver.findElement(By.id("XXX"));
    
    Action dragAndDrop =act.moveToElement(source,destination).build().perform();
    

提交回复
热议问题