Discord-OTP-Forcer icon indicating copy to clipboard operation
Discord-OTP-Forcer copied to clipboard

[Bug]: NoSuchElementException

Open uxshade opened this issue 10 months ago • 2 comments

Description

I tired running the application and got no element exist error

Minimal Reproduction

I ran the setup program and enter my information and program mode type login and normal. I then ran the start.bat file and I get this error the moment the login page loads.

Error

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="password"]"} (Session info: chrome=135.0.7049.116); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception Stacktrace: GetHandleVerifier [0x00007FF6F17DEFA5+77893] GetHandleVerifier [0x00007FF6F17DF000+77984] (No symbol) [0x00007FF6F15A91BA] (No symbol) [0x00007FF6F15FF16D] (No symbol) [0x00007FF6F15FF41C] (No symbol) [0x00007FF6F1652237] (No symbol) [0x00007FF6F162716F] (No symbol) [0x00007FF6F164F07F] (No symbol) [0x00007FF6F1626F03] (No symbol) [0x00007FF6F15F0328] (No symbol) [0x00007FF6F15F1093] GetHandleVerifier [0x00007FF6F1A97B6D+2931725] GetHandleVerifier [0x00007FF6F1A92132+2908626] GetHandleVerifier [0x00007FF6F1AB00F3+3031443] GetHandleVerifier [0x00007FF6F17F91EA+184970] GetHandleVerifier [0x00007FF6F180086F+215311] GetHandleVerifier [0x00007FF6F17E6EC4+110436] GetHandleVerifier [0x00007FF6F17E7072+110866] GetHandleVerifier [0x00007FF6F17CD479+5401] BaseThreadInitThunk [0x00007FFEE1DF7374+20] RtlUserThreadStart [0x00007FFEE263CC91+33]

Operating System Version

Windows 10

Browser and Browser Version

chrome 135.0.7049.116

Python Version

3.13

Program Version

fae7173

Any other information or context?

No response

uxshade avatar Apr 29 '25 21:04 uxshade

What programMode are you running the program in? Normal or Reset?

Derpitron avatar Apr 30 '25 06:04 Derpitron

What programMode are you running the program in? Normal or Reset?

I'm using normal mode

uxshade avatar Apr 30 '25 12:04 uxshade

I'm not able to reproduce this myself, it works completely fine for me. What codeMode and browser are you using? Also, it will help me if you could upload a screen recording of the program and the browser running together when it crashes like this.

Derpitron avatar May 17 '25 08:05 Derpitron

I'm not able to reproduce this myself, it works completely fine for me. What codeMode and browser are you using? Also, it will help me if you could upload a screen recording of the program and the browser running together when it crashes like this. Below are some screen shots and video.

Hi Sorry for the late replay. I'm running chrome. When the page loads up, only the background image of the site is loaded, the error message appears. Once the error appears then the login text box is loaded onto the screen. Below is the requested image and screen shots of the error and my settings

https://github.com/user-attachments/assets/4f00fd59-6147-4850-ad98-eaffb1c92161

Image

Image

uxshade avatar May 17 '25 13:05 uxshade

diff --git a/src/backend.py b/src/backend.py
index 02f99e4..4fee342 100644
--- a/src/backend.py
+++ b/src/backend.py
@@ -101,9 +101,15 @@ def bootstrap_login_page(
 	is caught while trying to find the TOTP login field, the function continues to run, assuming that the hCaptcha has been completed.
 	"""
 	# Find the login input fields
-	login_fields = {
-		'password': driver.find_element(by=By.NAME, value='password')
-	}
+	login_fields = {}
+
+	try:
+	    login_fields['password'] = WebDriverWait(driver, 10).until(
+	        EC.presence_of_element_located((By.NAME, 'password'))
+	    )
+	finally:
+		raise TimeoutException("Login page didn't load in fast enough")
+
 	match configuration['programMode'].lower():
 		case 'login':
 			login_fields['email'] = driver.find_element(by=By.NAME, value='email')

Could you copy the above .patch file, apply it in your local copy of the program, and test the program for me? (1. cd to the program's main folder, 2. git apply /path/to/patchfile.patch? https://gist.github.com/nepsilon/22bc62a23f785716705c See here for instructions)

I'm not able to test this myself, because it seems this is a network issue and the page is loading slowly only for you, while it's loading fast (and showing no errors) for me.

Derpitron avatar May 18 '25 10:05 Derpitron

diff --git a/src/backend.py b/src/backend.py index 02f99e4..4fee342 100644 --- a/src/backend.py +++ b/src/backend.py @@ -101,9 +101,15 @@ def bootstrap_login_page( is caught while trying to find the TOTP login field, the function continues to run, assuming that the hCaptcha has been completed. """

Find the login input fields

  • login_fields = {
  • 'password': driver.find_element(by=By.NAME, value='password')
    
  • }
  • login_fields = {}
  • try:
  • login_fields['password'] = WebDriverWait(driver, 10).until(
    
  •     EC.presence_of_element_located((By.NAME, 'password'))
    
  • )
    
  • finally:
  • raise TimeoutException("Login page didn't load in fast enough")
    
  • match configuration['programMode'].lower(): case 'login': login_fields['email'] = driver.find_element(by=By.NAME, value='email') Could you copy the above .patch file, apply it in your local copy of the program, and test the program for me? (1. cd to the program's main folder, 2. git apply /path/to/patchfile.patch? https://gist.github.com/nepsilon/22bc62a23f785716705c See here for instructions)

I'm not able to test this myself, because it seems this is a network issue and the page is loading slowly only for you, while it's loading fast (and showing no errors) for me.

I ran the update and I got a page, didn't load fast enough error.

Image

uxshade avatar May 18 '25 20:05 uxshade

Re-apply the patch and change the "10" to "20", or another big number. Keep raising and lowering until you find something that works for you.

Derpitron avatar May 19 '25 11:05 Derpitron

Re-apply the patch and change the "10" to "20", or another big number. Keep raising and lowering until you find something that works for you.

I kept increasing the wait time and it doesn't seem to do anything. it loads at the same speed every time, I even entered 1000000000, just to make sure and i don't see a difference in the programs speed.

uxshade avatar May 19 '25 21:05 uxshade

That's got to be a problem with your internet then.

Re-apply the patch and change the "10" to "20", or another big number. Keep raising and lowering until you find something that works for you.

I kept increasing the wait time and it doesn't seem to do anything. it loads at the same speed every time, I even entered 1000000000, just to make sure and i don't see a difference in the programs speed.

But still weird that the program, even after being told to wait for 20 seconds, doesn't wait.

Derpitron avatar May 21 '25 12:05 Derpitron

That's got to be a problem with your internet then.

Re-apply the patch and change the "10" to "20", or another big number. Keep raising and lowering until you find something that works for you.

I kept increasing the wait time and it doesn't seem to do anything. it loads at the same speed every time, I even entered 1000000000, just to make sure and i don't see a difference in the programs speed.

But still weird that the program, even after being told to wait for 20 seconds, doesn't wait.

I got it working, I removed the try finally statement as when I open in vsCode, it gave a line indent error. I tried re-spacing them, but the error would not go away. When I remove the try statement and kept the delay, it started working. I think it was hitting the finally statement raise error, and not really running the delay webdriver inside the try statement. This is an error my end and my apology. Again Thank you for your help!

uxshade avatar May 22 '25 15:05 uxshade

You removed the finally statement too?

Derpitron avatar May 22 '25 17:05 Derpitron

You removed the finally statement too?

Yes, removing both made the program work. The finally statement had the indent line error, after removing it, the try statement began showing as an error, so I removed it as well.

uxshade avatar May 22 '25 18:05 uxshade

Thanks for the help! Try the latest version and let me know if it works

Derpitron avatar May 22 '25 18:05 Derpitron