Closed Bug 1231119 Opened 9 years ago Closed 9 years ago

RemoteWebDriver.__init__ stalls on WIndows machine

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: edluzonjr, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36 Steps to reproduce: I have downloaded the nightly build of wires as instructed in this document: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver Then I run the following code: import os from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.common.keys import Keys data_path = os.path.expanduser(os.path.join('~', 'tronline', 'nboss-ci', 'testrunner')) os.path.join(data_path, 'tools', 'marionette', 'wires.exe') firefox_capabilities = DesiredCapabilities.FIREFOX firefox_capabilities['marionette'] = True firefox_capabilities['binary'] = os.path.join(data_path, 'tools', 'marionette', 'wires.exe') driver = webdriver.Firefox(capabilities=firefox_capabilities) driver.get("http://www.python.org") Actual results: The code stalls execution on the following line: driver = webdriver.Firefox(capabilities=firefox_capabilities) The command line never returns and code execution is frozen. I checked the status of Service and it seems to have started properly: code from selenium\py\selenium\webdriver\firefox\webdriver.py --------- if "marionette" in capabilities and capabilities['marionette'] is True: # Let's use Marionette! WOOOOHOOOOO! if "binary" in capabilities: self.binary = capabilities["binary"] self.service = Service(executable_path, firefox_binary=self.binary) self.service.start() self.write_file('ServiceCommand.txt', "Marionette Service: STARTED") self.write_file('ServiceCommand.txt', "URL: {}".format(self.service.service_url)) RemoteWebDriver.__init__(self, command_executor=FirefoxRemoteConnection( remote_server_addr=self.service.service_url), desired_capabilities=capabilities, keep_alive=True) self.write_file('ServiceCommand.txt', "RemoteWebDriver: INITIALIZED") --------- Then I get this log in ServiceCommand.txt: ['wires', '-b', 'C:\\Users\\ernesto.luzon\\tronline\\nboss-ci\\testrunner\\tools\\marionette\\wires.exe', '--webdriver-port', '57069'] Successfully connected to port: 57069 Marionette Service: STARTED URL: http://localhost:57069 And the log in geckodriver.log is: Usage: C:\Users\ernesto.luzon\tronline\nboss-ci\testrunner\tools\marionette\wires.exe [OPTIONS] C:\Users\ernesto.luzon\tronline\nboss-ci\testrunner\tools\marionette\wires.exe: Unknown option --marionette Expected results: Command line should return a driver and execute the next code: driver.get("http://www.python.org")
I downloaded the nightly build of firefox and updated my code with: firefox_capabilities = DesiredCapabilities.FIREFOX firefox_capabilities['marionette'] = True firefox_capabilities['binary'] = r'C:\Program Files\Nightly\firefox.exe' Now I can see a Firefox instance being launched and the geckodriver.log result is now: ------------ 1449587382152 Marionette INFO Marionette enabled via build flag and pref 1449587382356 Marionette INFO Listening on port 2828 1449587382702 Marionette INFO Accepted connection conn0 from 127.0.0.1:58106 Handler function DebuggerTransport instance's this.hooks.onPacket threw an exception: TypeError: Unrecognised message type in packet: {"name":"newSession","parameters":{"capabilities":null,"sessionId":null}} Stack: Message.fromMsg@chrome://marionette/content/message.js:53:1 Dispatcher.prototype.onPacket@chrome://marionette/content/dispatcher.js:80:13 DebuggerTransport.prototype._onJSONObjectReady/<@chrome://marionette/content/server.js -> resource://devtools/shared/transport/transport.js:479:9 makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:87:14 makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:87:14 Line: 53, column: 1 JavaScript warning: https://self-repair.mozilla.org/en-US/repair/, line 8: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create ------------ However, still the code execution stalls on the same spot and the following code is not executed: driver.get("http://www.python.org")
Bug 1211489 introduced message sequencing in the Marionette protocol and it appears this change is not reflected in the Selenium implementation. Please file a bug with the Selenium project to update the Marionette protocol to support level 3. See this thread to tools-marionette@ for further explanation: https://groups.google.com/d/msg/mozilla.tools.marionette/ZVWNINCjrTQ/hGtMg26oBgAJ
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
This needs to be fixed in Wires and not in the Selenium project. Thanks for raising this and we will get this sorted soon.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Version: 1.9.0 Branch → unspecified
Right, my mistake. I thought the Selenium Python client implemented the protocol directly.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Fix confirmed... thanks!
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.