Selenium2 + phpunit->在xpath上拖放 [英] Selenium2 + phpunit -> drag and drop on xpath

查看:78
本文介绍了Selenium2 + phpunit->在xpath上拖放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PHPUnit_Extensions_Selenium2TestCase Selenium和phpunit,并且我需要在不同的润饰剂上拖放一个xpath元素.像在此屏幕上一样,更改树(类别树)上的位置

I use PHPUnit_Extensions_Selenium2TestCase Selenium and phpunit and I need make drag and drop one xpath element, on diferent emelent. Like on this screen, to change position on tree (category tree)

推荐答案

  $srcDrag=$this->byId('draggable');
  $targetDrop=$this->byId('droppable');
  $stateChecker=$this->byCssSelector('#droppable > p');
  $this->assertEquals("Drop here",$stateChecker->text());


  $this->moveto($srcDrag);
  $this->buttondown();
  $this->moveto($targetDrop);
  $this->buttonup();

这篇关于Selenium2 + phpunit->在xpath上拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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