Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moz/addon/install not success #2177

Closed
StarXXin opened this issue Apr 24, 2024 · 3 comments
Closed

moz/addon/install not success #2177

StarXXin opened this issue Apr 24, 2024 · 3 comments
Labels

Comments

@StarXXin
Copy link

System

  • Version: firefox 82.0 and 124.0.2 (64 位)

  • Platform: Windows 10 and Linux

  • Firefox:
    image

  • Selenium: 3.141.0 and seleniod 1.10.7 geckodriver-v0.33.0-win64

Testcase

POST /session/{session id}/moz/addon/install to install an extension [Gecko only]
request Body:
{"path": "base64('a.xpi')", "temporary":true}

Stacktrace

{
"value": {
"error": "unknown error",
"message": "Expected absolute path: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: chrome://remote/content/marionette/addon.sys.mjs :: install :: line 72" data: no]",
"stacktrace": "RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:192:5\nUnknownError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:816:5\ninstall@chrome://remote/content/marionette/addon.sys.mjs:74:13\nGeckoDriver.prototype.installAddon@chrome://remote/content/marionette/driver.sys.mjs:2954:21\ndespatch@chrome://remote/content/marionette/server.sys.mjs:318:40\nexecute@chrome://remote/content/marionette/server.sys.mjs:289:16\nonPacket/<@chrome://remote/content/marionette/server.sys.mjs:262:20\nonPacket@chrome://remote/content/marionette/server.sys.mjs:263:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.sys.mjs:494:20\n"
}
}

Trace-level log

@whimboo
Copy link
Collaborator

whimboo commented Apr 29, 2024

Whether you are using a local path to the XPI file, which as best should be absolute, or you have to read the contents of the XPI file first before calling base64 related methods.

Note that the above just assumes that the path to the XPI is base64('a.xpi').

@whimboo whimboo closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
@StarXXin
Copy link
Author

Yes, I am using an absolute path xx. xpi (D: \ xx. xpi) file. I would like to know how to pass the value of path in the request parameters {"path": "", "temporary": true} for the POST/session/{session id}/moz/add/install method. I have obtained the value corresponding to the path through this method now.
Extension_zip_path='D: \ \ xx. xpi '
Profile=Firefox Profile()
Profile. add_extension (extension_zip_path)
Driver=webdriver Remote (command_executor=command_executor, desired capabilities=capabilities, options=options, profile=profile)
Then take out functionalities. get ('alwaysMatch '). get ('moz: firefoxOptions'). get ('pfofile') and assign it to the path

@whimboo
Copy link
Collaborator

whimboo commented Apr 30, 2024

Please create a trace log given that I do not know how Selenium constructs specific commands for the profile setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants