• 平台 测试笔记


    1.  点击某个图标,只有点击左半边有效(左半边是一个链接,右半边是一个div),click()选中的是元素的中间位置。用以下方法可解决

    Actions action = new Actions(view);
    //X,Y坐标是从元素的左上角开始的
    action.moveToElement(firstDemo,0,1).click().perform();

    2. frame:  webdriver每次只能在一个页面识别,因此才需要用switchTo.frame方法去获取frame中嵌入的页面,对那个页面里的元素进行定位。

    switchTo.defaultContent方法的话则是从frame中嵌入的页面里跳出,跳回到最外面的原始页面中(跳出所有frame)。

    3.获得id属性的值   String aiid = ai.getAttribute("id");

    4.取出for循环的返回值,变量要定义在for循环外。

     5.等待元素到可点击状态

    WebDriverWait wait = new WebDriverWait(dr,10);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("clc")));

    6.怎么把移动条下移和上移(用js)

    ((JavascriptExecutor)dr).executeScript("document.getElementById('id').scrollTop=10000");  下移到最底端

    ((JavascriptExecutor)dr).executeScript("document.getElementById('id').scrollTop=0");    上移到最顶端

    7.selenium可能会报错:element is not clickable at point. other element would receive the click         暂时用thread.sleep(2000);解决

     8.当google chrome报错:your profile can not used ,because.... 可以删掉chrome文件夹里的Web data文件。参考:http://hi.baidu.com/fcstom/item/ae23d217b2552fdfbf9042a4。

    9.webdriver输入enter键。  Actions act = new Actions(dr);       act.sendKeys(Keys.RETURN);

       输入tab键: act.sendKeys(Keys.ENTER);

    10. autoIt 看 

    11。

  • 相关阅读:
    sourceTree和eclipse 的使用
    oracle习题练习
    oracle详解
    单例模式
    反射详解
    Oracle 存储过程判断语句正确写法和时间查询方法
    MVC4 Jqgrid设计与实现
    遇到不支持的 Oracle 数据类型 USERDEFINED
    ArcGIS Server10.1 动态图层服务
    VS2010连接Oracle配置
  • 原文地址:https://www.cnblogs.com/aazhangqq/p/3731528.html
Copyright © 2020-2023  润新知