HOW TO: Install Chromedriver for Mac OS X / Selenium / Python

Selenium is great for automated testing of web-apps and I’ve been using the Firefox extension Selenium IDE for a few months now.

For completeness of automated testing for web apps you need to do this in a number of different browsers which Selenium IDE doesn’t do. So you’ll need to download and install Selenium on your Mac.

You can follow my  Java or  Python instructions to get started and install Selenium on your Mac.

Download Chromedriver to your Mac

Head over to the Chromedriver Project page and download the latest package.

You then need to unzip the package and then copy the file to /usr/bin

This is a hidden system folder so the easy way to get to this file is

  1. Open another finder window
  2. From the Go menu select Go To Folder
  3. Type /usr/bin and press enter

Now drag n drop the Chromedriver file from your Download folder to this directory. You’ll be prompted for you Admin password.

Finally, I suggest you restart your computer  as the next step didn’t work when I tried it.

Basic Test Case for Chromedriver and Selenium

If you’ve already followed my guide to setup Selenium via Python then this will look familiar

Open a terminal window and type the following, pressing enter at the end of each line

python
from selenium import webdriver
driver = webdriver.Chrome()

After a few seconds, if all is well a new instance of Chrome will open

To finish the test just type

driver.get("http://www.damien.co")

To exit Python from your open Terminal, press ctrl+z

Tags: 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值