一、UI自动化环境安装配置

UI自动化环境安装配置

安装selenium

1、以管理员分身执行cmd, 进入cmd的界面后执行

  • 输入pip install selenium命令,按回车键开始下载安装

image

  • 安装完成后打开PyCharm,点击设置,点击项目,点击python解释器

image

安装chrome浏览器驱动

  • 查看谷歌浏览器版本
    • 在谷歌浏览器的帮助菜单, 关于

image

chrome浏览器驱动下载

网址1:	http://chromedriver.storage.googleapis.com/index.html
网址2:	http://npm.taobao.org/mirrors/chromedriver/
小版本对应关系
 { "2.46": "71.0.3578",
  "2.45": "70.0.0",
  "2.44": "69.0.3497",
  "2.43": "69.0.3497",
  "2.42": "68.0.3440",
  "2.41": "67.0.3396",
  "2.40": "66.0.3359",
  "2.39": "66.0.3359",
  "2.38": "65.0.3325",
  "2.37": "64.0.3282",
  "2.36": "63.0.3239",
  "2.35": "62.0.3202",
  "2.34": "61.0.3163",
  "2.33": "60.0.3112",
  "2.32": "59.0.3071",
  "2.31": "58.0.3029",
  "2.30": "58.0.3029",
  "2.29": "57.0.2987",
  "2.28": "55.0.2883",
  "2.27": "54.0.2840",
  "2.26": "53.0.2785",
  "2.25": "53.0.2785",
  "2.24": "52.0.2743",
  "2.23": "51.0.2704",
  "2.22": "49.0.2623",
  "2.21": "46.0.2490",
  "2.20": "43.0.2357",
  "2.19": "43.0.2357",
  "2.18": "43.0.2357",
  "2.17": "42.0.2311",
  "2.16": "42.0.2311",
  "2.15": "40.0.2214",
  "2.14": "39.0.2171",
  "2.13": "38.0.2125",
  "2.12": "36.0.1985",
  "2.11": "36.0.1985",
  "2.10": "33.0.1751",
  "2.9": "31.0.1650",
  "2.8": "30.0.1573",
  "2.7": "30.0.1573",
  "2.6": "29.0.1545",
  "2.5": "29.0.1545",
  "2.4": "29.0.1545",
  "2.3": "28.0.1500",
  "2.2": "27.0.1453",
  "2.1": "27.0.1453",
  "2.0": "27.0.1453"
}
  • 下载完成后chromedriver_win32.zip, 解压之后是一个chromedriver.exe文件
第一步: 新建一个文件夹, 这个文件夹的路径不要有特殊符号,空格以及中文, 尽量简单
C:\file\teach\driver   例如
第二步: 把chromedriver.exe拷贝到第一步创建的文件夹中
第三步: 把新建的文件夹加入到系统的path环境变量中

image

image

image

image

image

posted @ 2022-05-19 20:27  鬼谷仙生  阅读(164)  评论(0编辑  收藏  举报