Marionette是一种用于远程控制 Mozilla 浏览器的协议。Chromium 有用于相同目的的DevTools协议,并在此处进行了记录。
Marionette这里有一些粗略的文档,但是有可用命令和参数的正确列表吗?可以以某种方式从 Mozilla 源中提取它吗?(就像 Chromium 有PDL一样。)
[0,1,"WebDriver:Navigate",{"url":"http://awe.lv"}]}]
我所说的命令是指“WebDriver:GetTitle”、[0,2,"WebDriver:ExecuteAsyncScript",{"script":"alert('Hello!')"}]
“WebDriver:GetWindowHandle”、“WebDriver:GetWindowRect”、“WebDriver:TakeScreenshot”和“WebDriver:GetPageSource”之类的命令。特别是,我想像使用 DevTools 的方法一样观察网络流量Network.enable。
是否还有其他可用前缀(“WebDriver:”除外)?我们可以通过 Marionette使用Web API吗?
随着Marionette取代FirefoxDriver,我需要配置我的测试来运行它.我已经下载了二进制文件,但我似乎无法将我的Capybara驱动程序注册配置为实际使用Marionette.
Capybara.register_driver :selenium_firefox do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
capabilities["firefox_binary"] = 'path/to/marionette/renamed/to/wires'
Capybara::Selenium::Driver.new(app, browser: :firefox, desired_capabilities: capabilities)
end
Run Code Online (Sandbox Code Playgroud)
当我开始测试时,我只是得到FF的初始页面,就像我试图在没有牵线木偶的情况下运行它一样.
我很难通过木偶创建两个firefox实例.有一个实例正常工作:
启用带有木偶的Firefox启动:
firefox.exe -marionette
Run Code Online (Sandbox Code Playgroud)
用python控制它:
from marionette import Marionette
client = Marionette('localhost', port=2828)
client.start_session()
client.execute_script("alert('o hai there!');")
Run Code Online (Sandbox Code Playgroud)
现在我想添加第二个客户端和当前客户端,快速搜索导致--address命令:
firefox.exe -marionette --address=localhost:2829
Run Code Online (Sandbox Code Playgroud)
试图通过python控制它:
from marionette import Marionette
client = Marionette('localhost', port=2829)
client.start_session()
client.execute_script("alert('o hai there!');")
Run Code Online (Sandbox Code Playgroud)
但是,我似乎无法使其工作:
error: [Errno 10061] No connection could be made because the target machine actively refused it
Run Code Online (Sandbox Code Playgroud)
任何帮助是极大的赞赏.
我正在尝试将一些Selenium测试转换FirefoxDriver为MarionetteDriver,但我遇到了有关PKI的问题.到目前为止,我的解决方案是使用各种Firefox配置文件,这些配置文件只有一个自定义PKI并自动选择用于登录目的.但是,似乎MarionetteDriver构造函数无法使用自定义配置文件启动Firefox.我该如何解决?
我在Python中通过让Python连接到Marionette之前启动Firefox来解决这个问题,但我不知道Selenium WebDriver是否具备此功能.
我目前正在尝试在本地运行机器人框架测试脚本(Ubuntu 12.04 LTS 64位).我遇到的问题是无法在开放浏览器中启动FF浏览器.以下是我所拥有的设置的详细信息/规格.
请注意我使用相同的机器作为集线器和节点(硒网格)
这里是启动我的集线器的命令:
java -jar selenium-server-standalone-2.53.1.jar -role hub -port 4444
Run Code Online (Sandbox Code Playgroud)
虽然这是注册我的节点的命令:
java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://localhost:4444/grid/register -trustAllSSLCertificates
Run Code Online (Sandbox Code Playgroud)
我在https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver(在PATH中添加可执行的电线)中执行了以下操作.
我也做了:
${ff default caps} Evaluate sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX sys,selenium.webdriver
Set To Dictionary ${ff default caps} marionette=${True}
Create Webdriver Firefox executable_path=\home\my\wires
Open Browser ${HOMEPAGE} ff None ${HUB}
Run Code Online (Sandbox Code Playgroud)
结果,FF浏览器启动,但没有打开URL $ {HOMEPAGE}.我一直在谷歌搜索并坚持这个问题这么久.请帮忙..
selenium-grid robotframework selenium-webdriver firefox-marionette
当我运行我的selenium代码时,我收到错误"错误:找到参数'--webdriver-port'这是不期望的,或者在此上下文中无效"
我正在使用Firefox 48.0使用gecko驱动程序我已经初始化了浏览器.并得到上述错误.