I get Javascript exception error: selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of undefined (reading 'click') I use the same "click" script driver.execute_script("arguments[0].click();", demo_element) But I used a different script to select the element on a different website (it works (finds the element) on the website) demo_element = driver.execute_script("return document.getElementsByTagName('a')[6];") Why the exception happens? How to fix it?
Hi sir. I have a javascript file (with variables & functions). I load and execute the file with driver.execute_script open.file.read, everything is good, but if I try to acces a variable from executed block code, I get "can't find variable x", and that variable I declared on the js file. Any idea?
@Paul Fogoros I think the problem is that the JS is run in your browser's console, not in your Python. Hence, it is natural that Python cannot get that variable x, because Python is not responsible for it for its whole lifetime. You may use `driver.execute_script("return xxx;")` to get some return values. But I am not sure if you can retrieve values of any executed script in this way. I am interested to know the results if you try it out.
Hi all ,am getting an exception JavascriptException: Message: javascript error: arguements is not defined ,can anyone help me out to overcome this exception.
@@softwaretestingmentor sir I need java logic to scroll down two Times down for infinite scroll using selenium. I'm using javascript executor, but I am unable to scroll down using the scroll methods. Can you help me please? I have seen a python code, but how to convert it into java?
I was struggling to click an element that was not interactable with python, executing this script with JavaScript solved it. Thank you a lot.
I'm searching for this answers for almost a week. Great stuff!
Just the tutorial I wanted. Thanks.
Great explanation, Sir! Thank you 💙💛
Thanks! You helped me!
Glad I could help! 😊
Keep watching for more videos.
Thank you so much!!!!
thank you that really helped me :)
Glad it helped.
Keep watching for more videos!
I get Javascript exception error:
selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of undefined (reading 'click')
I use the same "click" script
driver.execute_script("arguments[0].click();", demo_element)
But I used a different script to select the element on a different website (it works (finds the element) on the website)
demo_element = driver.execute_script("return document.getElementsByTagName('a')[6];")
Why the exception happens? How to fix it?
Hi sir. I have a javascript file (with variables & functions). I load and execute the file with driver.execute_script open.file.read, everything is good, but if I try to acces a variable from executed block code, I get "can't find variable x", and that variable I declared on the js file. Any idea?
@Paul Fogoros I think the problem is that the JS is run in your browser's console, not in your Python. Hence, it is natural that Python cannot get that variable x, because Python is not responsible for it for its whole lifetime.
You may use `driver.execute_script("return xxx;")` to get some return values. But I am not sure if you can retrieve values of any executed script in this way. I am interested to know the results if you try it out.
Namastay sir, unable to write the path using the java_scrypt
if u have posted any tutorial for that please share
Hi all ,am getting an exception JavascriptException: Message: javascript error: arguements is not defined ,can anyone help me out to overcome this exception.
Treasure
Hello sir.
Hello there!
@@softwaretestingmentor sir I need java logic to scroll down two Times down for infinite scroll using selenium. I'm using javascript executor, but I am unable to scroll down using the scroll methods. Can you help me please? I have seen a python code, but how to convert it into java?