Selenium拖放测试javascript

时间:2021-10-01 00:08:36

Need your help in such a specific situation. I use Selenium framework for testing the application, which based on "ext js" library. There are 2 trees of elements. I need to move an element from one tree to another element in the second tree. I use dragAndDropToObject(xpath1,xpath2); I can see that method takes 'xpath1' element, tries to bring it to the 'xpath2' element and no result - the element 'xpath1' comes back to the previous place. It seems like the method doesn't see the pointed object, doesn't release a taken element on that. If I use another method of Selenium - f.e. click(xpath2); - it clicks on the pointed object, so the problem is in dragAndDropToObject.

在这种特定情况下需要你的帮助。我使用Selenium框架来测试应用程序,它基于“ext js”库。有2棵树的元素。我需要将元素从一棵树移动到第二棵树中的另一个元素。我使用dragAndDropToObject(xpath1,xpath2);我可以看到该方法采用'xpath1'元素,尝试将其带到'xpath2'元素并且没有结果 - 元素'xpath1'返回到前一个位置。看起来这个方法看不到指向的对象,也没有释放出一个被采用的元素。如果我使用另一种硒方法 - f.e.单击(xpath2); - 它点击指向的对象,因此问题出在dragAndDropToObject中。

1 个解决方案

#1


2  

I think you'll have to extend selenium by the user-extensions.js file.

我认为你必须通过user-extensions.js文件扩展selenium。

Drag & drop selenium tests have been made on the SweetDEV RIA open source tag library.

已经在SweetDEV RIA开源标签库上进行了拖放硒测试。

You may find a very interesting method (Selenium.prototype.doDragTo) on the SweetDEV RIA SVN repository.

您可以在SweetDEV RIA SVN存储库中找到一个非常有趣的方法(Selenium.prototype.doDragTo)。

#1


2  

I think you'll have to extend selenium by the user-extensions.js file.

我认为你必须通过user-extensions.js文件扩展selenium。

Drag & drop selenium tests have been made on the SweetDEV RIA open source tag library.

已经在SweetDEV RIA开源标签库上进行了拖放硒测试。

You may find a very interesting method (Selenium.prototype.doDragTo) on the SweetDEV RIA SVN repository.

您可以在SweetDEV RIA SVN存储库中找到一个非常有趣的方法(Selenium.prototype.doDragTo)。