• 测试新技术、工具、自动化问题汇总



    【Robot framework】

    @环境安装

    https://blog.csdn.net/ywyxb/article/details/64126927

    @Firefox已停止工作

    Selenium官方并无明确说明,但是据网友反应,从47.0开始,只要在python中执行webdriver.Firefox(),firefox弹出后就会提示“Firefox已停止工作”可以试下47.0之前的版本。

    @selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
    1. selenium 3.x开始,webdriver/firefox/webdriver.py的__init__中,executable_path="geckodriver";而2.x是executable_path="wires"2. firefox 47以上版本,需要下载第三方driver,即geckodriver;在http://docs.seleniumhq.org/download/的Third Party Drivers, Bindings, and Plugins下面找到Mozilla GeckoDriver,下载到任意电脑任意目录,解压后将该路径加入到PC的path(针对windows)即可。


    @chrome 与Driver版本对应关系 https://blog.csdn.net/huilan_same/article/details/51896672
    链接:https://www.zhihu.com/question/49568096/answer/119324584

    @滚动条操作、根据目标元素定位
    driver.execute_script("scroll(0,2400)") # 这个比较粗劣,大概的拖动

    target_elem = driver.find_element_by_link_text(string)
    driver.execute_script("return arguments[0].scrollIntoView();", target_elem) # 用目标元素参考去拖动

    @上传、下载
    用到库pywin32 autoit AutoItLibrary

    @RFS加载库、资源
    1.自定义库可以在D:Python27Libsite-packages 新建一个类
    2.新建一个文件MyLibrary 里面新建__init__.py、 mytool.py
    参考:https://blog.csdn.net/xiaomageit/article/details/51870468
    3. 当前目录新建一个var.py 之后导入import variables ${CURDIR}//var.py

    @元素不可见、只读
    Execute Javascript document.getElementById('end_date').removeAttribute("readonly") #设置可写

    @下拉框标准与非标准
    标准的按照 select from list by value
    不标准的按照 Select From List By Index

    @指定报告路径
    在Arguments输入 -d D:\RFS

    @Excel数据读取
    --ExcelLibrary 安装依赖其他库 看log提示提示需要安装依赖库

  • 相关阅读:
    Linux下Redis集群环境的搭建
    redis: 6379端口下set值时出现 CLUSTERDOWN The cluster is down
    运行Maven工程总是报错:No goals have been specified for this build
    Centos6.5 配置Nginx开机自启动
    centos6.5无法访问网络
    centos6.5 nginx-1.8.0和ftp搭建图片服务器
    HTML中使图片居中显示
    使用InstallAnywhere工具打包Java_Web程序
    Android开发中Parcelable接口的使用方法
    Java8并行流使用注意事项
  • 原文地址:https://www.cnblogs.com/aeip/p/9044697.html
Copyright © 2020-2023  润新知