使用Robot framework打不开chrome

使用Robot framework打不开chrome_第1张图片

        昨天使用Robot framework的时候碰到了一个问题,搞得自己浪费了好几个小时,到最后才发现原因,现在记录一下,如果又遇到同样问题的,可以在这里找到答案。

我在做的途中,遇到的问题是:

[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open

Report:  c:\users\heyu~1.sun\appdata\local\temp\RIDEmzw1lu.d\report.html

unexpected error: Exception AttributeError: "'Service' object has no attribute 'process'" in > ignored

=========================================

这段话其实是说浏览器缺少驱动,需要下载相对应的驱动。

(PS:✺◟(∗❛ᴗ❛∗)◞✺。忘记截图了,就将就着看吧)

解决方法:

******找到自己谷歌浏览器的版本:

点击“:-----帮助---------关于Googel Chrome”

使用Robot framework打不开chrome_第2张图片

找到版本号,我这里的版本是60

使用Robot framework打不开chrome_第3张图片

*******找到与自己的版本对应的驱动

版本对应驱动:http://blog.csdn.net/huilan_same/article/details/51896672

(PS:60版本可以下载以下版本驱动)

使用Robot framework打不开chrome_第4张图片

*******下载谷歌驱动:

谷歌驱动:http://npm.taobao.org/mirrors/chromedriver/

使用Robot framework打不开chrome_第5张图片

下载之后,将chromedriver.exe放在指定的python的安装目录下,这样就可以使用Robot framework进行自动化操作了。

除此之外,我还遇到了另外一个问题,问题如下:

command: pybot.bat --argumentfile c:\users\qi\appdata\local\temp\RIDEnajmwn.d\argfile.txt --listener C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:49249:False E:\python\workspace\qiRobot\测试计划\测试项目

解决方法:

1.设置环境变量:         PATH:C:\Python27\Scripts

2.打开cmd,键入pybot --version

使用Robot framework打不开chrome_第6张图片

                                                                            END

你可能感兴趣的:(使用Robot framework打不开chrome)