简体   繁体   English

拖动元素但不丢弃

[英]Dragging the element but not dropping

While working on Selenium with JavaScript(Chrome Browser), Need to drag and drop an element. 在使用JavaScript(Chrome浏览器)处理Selenium时,需要拖放元素。 With the below code, could able to drag but drop is not happening 使用下面的代码,可以拖动但不会发生下降

await driver.actions({bridge:true}).dragAndDrop(source,destination).perform();

I've found some solutions in Java, however I am working on Selenium with JavaScript. 我在Java中找到了一些解决方案,但我正在使用JavaScript开发Selenium。

试试这样

driver.actions({bridge:true}).dragAndDrop(source,destination).build().perform();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM