量角器。如何做拖放操作? [英] Protractor. How to do a drag and drop action?

查看:141
本文介绍了量角器。如何做拖放操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个量角器测试,我需要拖一些元素...基本上当时其他开发人员使用角度拖放来实现这个功能。我一直在寻找几个小时,但我还没有想到如何通过它。这是我试图拖动的元素。实际上,有4个可拖动的元素,我想拖动最后一个在第一个元素,以便首先最后一个:



this.draggableFields = element.all (by.css('dnd-nodrag'));



我使用最新版本的量角器和最新版本的webdriverJS。提前感谢你的时间。

解决方案

尝试这个:

  ptor.actions()。dragAndDrop(
ptor.findElement(protractor.By.css('dnd-nodrag'))。get(0);
ptor.findElement(量角器.by.css('dnd-nodrag'))。get(1);
ptor.findElement(protractor.By.css('dnd-nodrag'))。get(2);
ptor .findElement(protractor.By.css('dnd-nodrag'))。get(3);
).perform();


I am currently writing a protractor test and I need to drag a drop some elements... Basically the other developers at the time used angular drag and drop to implement this functionality. I have been searching for a couple of hours but I haven't figured out yet how to get through it. This is the element I am trying to drag. Actually, there are 4 draggable elements and I want to drag the last one on the first one in order to make first the last one:

this.draggableFields = element.all(by.css('dnd-nodrag'));

I using the latest version of protractor and the latest version of webdriverJS as well. Thanks in advance for your time.

解决方案

Make a try of this one :

  ptor.actions().dragAndDrop(
ptor.findElement(protractor.By.css('dnd-nodrag')).get(0);
ptor.findElement(protractor.By.css('dnd-nodrag')).get(1);
ptor.findElement(protractor.By.css('dnd-nodrag')).get(2);
ptor.findElement(protractor.By.css('dnd-nodrag')).get(3);
    ).perform();

这篇关于量角器。如何做拖放操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆