Click Interception in a weird place (or missing click) when attempting to click a button #3269
Jediweirdo
started this conversation in
General
Replies: 1 comment
-
If you need to click a hidden element (or an obscured element), you can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To be clear, this is probably not a bug more than it is something I'm implementing wrong. For a project I'm working on, I'm currently working on a way to give my users the option of logging in SeleniumBase through Google's login portal. Things go smoothly until Selenium needs to use the user's authenticator code to get passed two-factor authentication. Getting and inputting the MFA code works like a charm, but anytime SB tries to press the "Next" button, something gets in the way:
Google has 90% of their element attributes written in ancient tongue, so it's better if I show you a screenshot of the element in the wild:
I'm not a JS coder and certainly not a website designer so correct me if I'm wrong for saying this, but isn't that element supposed to be behind the next button? The only way I thought that this was possible was if the click was completely off its mark, so I tried different selectors hoping that it would change something (it did not). The ones I've tried so far are...
#totp
(a div a couple layers above the button)span:contains("Next")
andbutton:contains("Next")
(the text inside the button)button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.VfPpkd-LgbsSe-OWXEXe-dgl2Hf.nCP5yc.AjY5Oe.DuMIQc.LQeN7.BqKGqe.Jskylb.TrZEUc.lw1w4b
(Ancient Google Speak for the button itself)And here's the heavily-stripped-down code I gave SeleniumBase to fill out the 2fa page:
One thing to note about the code above is that
self.get_mfa_code
is not the same as SeleniumBase'sget_mfa_code
. Since my implementation of SeleniumBase uses syntax format #23 (Direct Import Driver Manager), I had to make my own version using pyotp (which I imagine the original version uses as well). Rest assured though, I've already tested my version ofget_mfa_code
and it works fine.With all that said, do you have any idea how the background of a page is intercepting with something in front of it? The code I had of this used to work fine mere hours ago, but if there's one thing code loves doing, it's randomly breaking whenever it feels like it.
Beta Was this translation helpful? Give feedback.
All reactions