mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Issue in termux with Arm7hf #2151

Closed dr1408 closed 5 months ago

dr1408 commented 5 months ago

Hello im using geckodriver 0.33 with firefox 121.0.1 from tur repo in termux on android device with Arm7

i use it for a tool called qrljackker with selenium =4.9.1

when i run the tool i got this error : could not open firefox somthing related to init() and executable path

i use python3.7 to run the module

i will post a picture of the browser.py lines affected by the problem

geckodriver.log = MOZ_CRASHREPORTER="1" MOZ_CRASHREPORTER_NO_REPORT="1" MOZ_CRAS> Error: no DISPLAY environment variable specified

dr1408 commented 5 months ago

8FD0FF21-1C4B-441A-99CA-4E0366F9C922

dr1408 commented 5 months ago

The problem related to the lines of controller i changed the path to /data/data/com.termux/files/usr/bin/geckodriver Where the geckodriver is : still same error

dr1408 commented 5 months ago

This is the browser.py of the tool : https://github.com/OWASP/QRLJacking/blob/master/QRLJacker/core/browser.py

it should use headless environment so why gecko failing because of display error ? Please if you can check the code

dr1408 commented 5 months ago

Here is the full traceback from the tool

run [+] Using the default useragent Exception: WebDriver.init() got an unexpected keyword argument 'executable_path' Trackback: Traceback (most recent call last): File "/data/data/com.termux/files/home/QRLJacking/QRLJacker/core/browser.py", line 76, in new_session new_headless[module_name]["Controller"] = Firefox(profile, executable_path="/usr/local/share/geckodriver", capabilities=caps)#options=self.opts) # Inserting the browser object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: WebDriver.init() got an unexpected keyword argument 'executable_path' [!] Couldn't open Firefox! Check the installation instructions again!

whimboo commented 5 months ago

As it looks like the headless flag might not make it to it through the capabilities. But I would need a trace log from geckodriver. As such can you please try to pass the -vv or --log=trace argument to geckodriver? The log should appear on stdout as long as the tool you are using is not storing it into a local file (which then might be called geckodriver.log). Thanks.

dr1408 commented 5 months ago

@whimboo sir i already posted the gecko log

geckodriver.log = MOZ_CRASHREPORTER="1" MOZ_CRASHREPORTER_NO_REPORT="1" MOZ_CRAS> Error: no DISPLAY environment variable specified

Also i guess there is problem in the exeutable path is it right or wrong because i change it in the browser.py on both lines .. please chech the browser.py of the tool i put the link to it .. thanks for response

dr1408 commented 5 months ago
whimboo commented 5 months ago

A trace log will contain way more internals as what has been posted yet. So please check that the mentioned flags are correctly forwarded to geckodriver.

dr1408 commented 5 months ago

Didn't get it sorry sir.. that's the only problem in the log is about the display envirmoent.. Also can I update geckodriver for termux on arm7 and how to do that

dr1408 commented 5 months ago

Ok so I used python3 instead of Python3.7

dr1408 commented 5 months ago

This is the tool trace back :

[+] Using the default useragent Exception: Message: Process unexpectedly closed with status 1

Trackback: Traceback (most recent call last): File "/data/data/com.termux/files/home/QRLJacking/QRLJacker/core/browser.py", line 76, in new_session new_headless[module_name]["Controller"] = Firefox(profile, executable_path="/data/data/com.termux/files/usr/bin/geckodriver", capabilities=caps)#options=self.opts) # Inserting the browser object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/selenium/webdriver/firefox/webdriver.py", line 201, in init super().init(command_executor=executor, options=options, keep_alive=True) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in init self.start_session(capabilities, browser_profile) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session response = self.execute(Command.NEW_SESSION, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute self.error_handler.check_response(response) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1

dr1408 commented 5 months ago

And this is the geckodriver.log 658E68C9-D2C9-421B-86A1-90411666A128

dr1408 commented 5 months ago

With python3.7 it produce only 1 error while with python3 it produces lot errors

Also the geckodriver log only generate on python3 not python3.7

Even if I test the driver on python3 it will work but on python3.7 show errors let me test it and show you

whimboo commented 5 months ago

Maybe it would be good to get the problem with the Python versions sorted out with the tool as well.

Regarding the geckodriver issue could you please let the output redirect to a file? The actual command for starting Firefox is cut-off in both your former comments and the screenshot.

dr1408 commented 5 months ago

Ok Sir my problem is solved I just needed to install termux xcfe package and export display to use it on Vince viewer