Robotframework-selenium- Edgebrowser-“选项"对象没有属性"use_chromium" [英] Robotframework-selenium- Edgebrowser - 'options' object has no attribute 'use_chromium'

查看:171
本文介绍了Robotframework-selenium- Edgebrowser-“选项"对象没有属性"use_chromium"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用robot-framework-selenium(3.1.1)框架,在需要的地方使用python.当前要使用Chrome,IE,Firefox打开浏览器,正在使用Robot-framework中的 Open Browser 关键字.要打开边缘浏览器,在Windows 8.1中,相同的 Open Browser 关键字不能与'options = chromium = true'一起使用,并且在Windows 10中,只有在edgedriver.exe设置之后,它才会抛出,

I am working with robot-framework-selenium(3.1.1) framework where I use python where ever necessary. Currently to open a browser with Chrome, IE, Firefox, am using Open Browser keyword from Robot-framework. To Open a edge browser, the same Open Browser keyword isn't working with 'options=chromium=true' in Windows 8.1 and, in Windows 10, only after edgedriver.exe setting, it is throwing,

未创建会话:未找到匹配功能";错误

"session not created : no matching capabilities found" error

如果有人已经使用edge-robotframework-win10,请提供您的意见.

If anyone has already worked with edge-robotframework-win10, kindly give your inputs.

然后我按照Win 8.1操作系统中提到的线程,创建了一个 EdgePlugin.py 类,并从git-hub位置

And I followed the thread that is mentioned in win 8.1 OS, I created a EdgePlugin.py class and copied the code from a git-hub location, https://github.com/Accruent/robotframework-zoomba/blob/master/src/Zoomba/Helpers/EdgePlugin.py

下面是使用的版本

1.robot-framework == 3.1.2
2.robotframework-SeleniumLibrary == 4.3.0
3.硒== 3.141.0
4.MSEdgeDriver 88.0.705.0
5.msedge-selenium-tools == 3.141.2

1.robot-framework==3.1.2
2.robotframework-SeleniumLibrary ==4.3.0
3.selenium==3.141.0
4.MSEdgeDriver 88.0.705.0
5.msedge-selenium-tools==3.141.2

用于 test_login.robot 文件

**Settings

    Library   SeleniumLibrary   plugins=pathto.EdgePlugin
    
**Keywords

    open browser  ${url}  ${browser}   remote_url=${grid_url}   options=use_chromium=True;headless=True

现在显示的错误有所不同,

Now am displayed with a different error,

AttributeError:选项"对象没有属性"use_chromium"

AttributeError: 'Options' object has no attribute 'use_chromium'

推荐答案

自从我实现它已有一段时间了,但是您是否将'browser'变量设置为'Edge'?也可能是因为您使用的是远程网格,所以选项的发送方式不同吗?

Its been awhile since I implemented that but are you setting your 'browser' variable to 'Edge'? Could also be that since you are using a remote grid that the way options are sent in is different?

否则,有什么原因使您不只是使用Zoomba?库的GUI部分扩展了SeleniumLibrary,因此您想要的所有关键字以及一些关键字更多.

Otherwise is there any reason you are not just using Zoomba? The GUI portion of the library extends SeleniumLibrary so all the keywords you would want are there along with some more.

然后您可以像示例一样运行它:

Then you could just run it like the example:

Library    Zoomba.GUILibrary     plugins=Zoomba.Helpers.EdgePlugin

Open Browser   https://www.google.com    browser=Edge     options=use_chromium=True

这篇关于Robotframework-selenium- Edgebrowser-“选项"对象没有属性"use_chromium"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆