需要依次点击页面的删除按钮,如下图: @Test public static void FaBu() { TestMenuJump.jumpExam(driver); TestMenuJump.jumpExamPa(driver); WebElement wes = driver...
分类:
其他好文 时间:
2015-06-29 21:44:59
阅读次数:
121
1. jsclick 也不管用Actions action = new Actions(driver); WebElement theRow = page.getInvisibleElement(); action.moveToElement(theRow).perfor...
分类:
其他好文 时间:
2015-06-24 18:19:34
阅读次数:
101
通常在编写 Selenium 的 WebUI 自动化脚本时,有些元素不易定位元素,或有些元素为隐藏的(此时用 WebElement.getText() 获取其值的时候,返回的结果为空),对日常的 UI 自动化脚本的编写造成了一定程度的影响。若亲有一定的前段开发基础,肯能会想到可否通过 JavaScr...
分类:
编程语言 时间:
2015-06-17 15:11:48
阅读次数:
170
当需要使用滚动条才能使页面元素显示在视野范围内时,必须用代码处理下,才能对其进行操作。处理其实也很简单,就是调用JS函数.driver.executeScript("arguments[0].scrollIntoView(false);", e);参数e 为WebElement 类型,方法execu...
分类:
其他好文 时间:
2015-06-16 16:42:42
阅读次数:
384
// get invisible element Actions action = new Actions(driver); WebElement theRow = page.getInvisibleElement(); action.moveToElement(theRow).per...
分类:
移动开发 时间:
2015-06-15 16:15:02
阅读次数:
126
public void dragWidgetToElementContainner(String widgetName, String targetPosition){ WebElement widgetIconEl=page.getWidgetIconInDockMenu(widgetName)....
分类:
其他好文 时间:
2015-06-09 16:14:03
阅读次数:
169
//@author jzhang6 public void dragAndDropOffset(WebDriver driver,WebElement dragableEl, WebElement dropableEl, int offsetX, int offsetY){ Actions act....
分类:
其他好文 时间:
2015-05-29 09:44:41
阅读次数:
809
转自:http://blog.sina.com.cn/s/blog_6966650401012a7q.html一、输入框(text field or textarea)//找到输入框元素:WebElement element = driver.findElement(By.id("passwd-id...
分类:
其他好文 时间:
2015-05-28 17:50:40
阅读次数:
176
//搜索二手房 ?import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.WebElement;? public class NewTest{??...
分类:
Web程序 时间:
2015-05-28 11:04:16
阅读次数:
320
第一种 先获取元素通过 属性获取WebElement webElemt= webElement.findElement(By.xpath("//*[@class='xxxxxx]/a"));//在ie下使用innerText 在火狐下使用textContentString linktext = we...
分类:
其他好文 时间:
2015-05-22 16:26:01
阅读次数:
246