zoukankan      html  css  js  c++  java
  • web自动化测试准备

    1.Chrome降为稳定版本,匹配对应的driver,禁止Chrome自动更新
    chrome浏览器版本过⾼,虽然根据官⽹上的信息,2.33的chrome驱动⽀持60-62的⾕歌。但是60根本不⾏
    解决办法:
    降级chrome
    Chrome与ChromeDriver版本对照表
    chrome浏览器各版本 http://www.chromedownloads.net/chrome64win/
    我使用的v68和对应点driver
    禁⽌⾕歌浏览器更新 https://jingyan.baidu.com/article/76a7e409f2137afc3b6e15be.html
    ChromeDriver 镜像 http://npm.taobao.org/mirrors/chromedriver
    Selenium 镜像 http://npm.taobao.org/mirrors/selenium
     

    准备火狐驱动文件geckodriver.exe(从selenium 3.0开始火狐浏览器的自动化就需要驱动文件来驱动了),这里准备的驱动文件版本为0.19.0,大家可以自己去selenium官网下载,或者直接使用老师给大家分享的网盘地址去下载【链接:https://pan.baidu.com/s/1oN8tg66cobM7yX-T6GKuFw 密码:9rb7】

     

    另外大家记得把火狐浏览器的版本更换为56(并且禁止浏览器更新功能,防止浏览器后台自动更新版本,至于怎么禁止,很简单的事情,pls自行百度),因为根据geckodriver的change log建议,0.19.0版本的驱动最好是适配:Firefox 55.0 (或更高)+ Selenium 3.5(或更高),这就是为什么上面为什么用selenium3.5.1。

     Firefox全历史版本下载:
    http://ftp.mozilla.org/pub/firefox/releases/
    Firefox驱动问题下载 
    禁止自动更新,一个粗暴直接的方法,把安装目录下两个updater文件删除掉(目前唯一有效的方法)
     
    2.导入maven坐标,selenium坐标
    <dependencies>
      <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>

            <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>3.141.59</version>
            </dependency>
    </dependencies>
     
  • 相关阅读:
    深入理解原型
    这次彻底理解了Object这个属性
    彻底理解了call()方法,apply()方法和bind()方法
    理解JavaScript中函数方法
    js常用的数组方法
    H5的canvas绘图技术
    深度理解DOM拷贝clone()
    深入理解面向对象中的原始类型和引用类型
    深入理解JavaScript的this指向问题
    .NET/ASP.NET Routing路由(深入解析路由系统架构原理)
  • 原文地址:https://www.cnblogs.com/xl95/p/12714933.html
Copyright © 2011-2022 走看看