如何使用新的geckodriver端点? [英] How to use new geckodriver endpoints?
问题描述
新的geckodriver v0.17.0有一个新的安装插件的方法,如这里:
POST / session / {session id} / window /全屏调用窗口管理器特定的全屏操作
POST / session / {session id} / moz / addon / install来安装一个扩展[Gecko only]
POST / session / {session id} / moz / addon / $ b
如何使用这些端点将我的插件安装到firefox进行硒测试?
您必须知道geckodriver启动的IP和端口。一旦geckodriver启动,您可以从驱动程序实例获取会话ID。
您可以获取IP地址和端口如前所述
例如:如果ip和port是
localhost:15874
和会话ID是 1e53412a-05eb-40a9-8a7b-bb8dd6fd75ab
然后你可以发布一个json消息给
pre $ http $ // localhost:15874 / session / 1e53412a -05eb-40a9-8a7b-bb8dd6fd75ab / moz / addon / install
邮件正文应该是
{
path:xxyy.xpi,
temporary:true
}
The new geckodriver v0.17.0 has a new way to install addons as mentioned here:
POST /session/{session id}/window/fullscreen to invoke the window manager-specific full screen operation
POST /session/{session id}/moz/addon/install to install an extension [Gecko only]
POST /session/{session id}/moz/addon/uninstall to uninstall an extension [Gecko only]
How can I use these endpoints to install my addon to firefox for my selenium tests?
You have to know the ip and port in which geckodriver starts. And Once the geckodriver started you can get the Session Id from the driver Instance.
You can get the Ip Address and Port as mentioned here
For ex: if the ip and port is
localhost:15874
and session id is 1e53412a-05eb-40a9-8a7b-bb8dd6fd75ab
Then you can post a json message to
http://localhost:15874/session/1e53412a-05eb-40a9-8a7b-bb8dd6fd75ab/moz/addon/install
The body of post message should be
{
"path":"xxyy.xpi",
"temporary":true
}
这篇关于如何使用新的geckodriver端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!