使用robotframework无法连接webdriver

在保证RF安装环境都是正确安装的前提,今天发现一个问题,就是无论我怎么使用open browser都报错,提示无法连接webdriver,网上有很多人都说是下载的webdriver版本不匹配,我也尝试去下载了最新版本,还是无法解决,最后访问了国外的一个网站,https://*.com/

解决了这个问题

原因是本机127.0.0.1  与localhost  不匹配

你可以在命令行中输入:drivers

点击/etc/hosts/查看

# Additionally, comments (such as these) may be inserted on individual

# lines or following the machine name denoted by a '#' symbol.

#

# For example:

#

#      102.54.94.97     rhino.acme.com          # source server

#       38.25.63.10     x.acme.com              # x client host


# localhost name resolution is handled within DNS itself.

# 127.0.0.1       localhost

# ::1             localhost


把注释去掉保存

再去尝试在RF中运行,查看能否打开浏览器