Hi All ,
Please help me to solve this error . Error is coming due to this script .
Java script used in the logic is : document.getElementsByClassName('popover-background-window')[0].click();
Can anyone help me where will I get the class name?
Regards,
Sohel
Hello,
I don't know the use case but you are trying to click somewhere is not in the DOM yet.
Add a timeout in your JS:
setTimeout(function() { document.getElementsByClassName('popover-background-window')[0].click(); }, 100);
If doesn't work let me know about the use case.
Regards
Thanks a lot @Paulo Torres . Its working fine now . Can you please brief me the root cause for this error and how you solved.
I'm glad to help you :)
The problem is because you are trying to click somewhere that you son't have in your DOM/not loaded yet. Maybe you are toggling between visible and hidden.
My script just add a timeout, so instead to click immediately, just will be clicked after 0.001 seconds. Normally it's enough to have the element in the DOM :)
Some learnings today :)