Handling consecutive auths using selenium?

  • Thread starter Thread starter Deleted member 658642
  • Start date Start date
D

Deleted member 658642

Guest
Hey guys,
For the first auth, im passing the username and password in the URL and that seems to work fine. But for the second consecutive auth, I’ve tried doing the same but it just repeats the cycle. I’ve also tried handling the auth box as an alert which just ends up giving me an error that such an alert doesn’t exist.

The site I’m trying to access needs authentication twice in a row even if the first attempt is successful. Is there any better way to handle two consecutive auths or just the second one alone?

Right now, I gotta enter the creds manually for the second auth which besides being tiresome is also a little insulting lol.

I’m trying to do this in Python btw but I’d also appreciate any help in Java if that’s up your alley. Sorry if I haven’t explained anything in detail. Thanks again for the help.

Cheers.
 
Do it exactly like you'd do it in the browser. Do you have to do it twice when you do it manually? Maybe your selenium settings differ so much that you have different flow.
 
Do it exactly like you'd do it in the browser. Do you have to do it twice when you do it manually? Maybe your selenium settings differ so much that you have different flow.
Thanks for replying. Yes, I do have to do it twice when I’m doing it manually. The problem is, with Selenium, I’m under the impression that there’s only one way to handle auths and that’s to pass the creds in the URL. I tried passing it twice to ‘simulate’ manual entry but it just keeps going in a loop. If there is another way I could handle the auth pop up, it would be great.
 
Just wait for pop up and fill fields/click whatever you need. The point of using selenium is doing something exactly (as possible) like you'd do like human, just in automated way.
 
Just wait for pop up and fill fields/click whatever you need. The point of using selenium is doing something exactly (as possible) like you'd do like human, just in automated way.
Thanks again for replying. I have tried to fill it out when it pops up using selenium but the problem is I can’t treat it as a regular alert. I spent the better half of an evening reading documentation and still kept getting the “No such alert” error. Would you suggest that I handle the pop up as a different method?
 
Thanks for replying. Yes, I do have to do it twice when I’m doing it manually. The problem is, with Selenium, I’m under the impression that there’s only one way to handle auths and that’s to pass the creds in the URL. I tried passing it twice to ‘simulate’ manual entry but it just keeps going in a loop. If there is another way I could handle the auth pop up, it would be great.
how are you selecting the username and password input areas, by id, xpath? After the first auth, are you examining the html of the second auth to figure out how to target the next set of inputs?
 
Thanks again for replying. I have tried to fill it out when it pops up using selenium but the problem is I can’t treat it as a regular alert. I spent the better half of an evening reading documentation and still kept getting the “No such alert” error. Would you suggest that I handle the pop up as a different method?
If this isn't top secret, feel free to DM me the site and I can take a look
 
how are you selecting the username and password input areas, by id, xpath? After the first auth, are you examining the html of the second auth to figure out how to target the next set of inputs?
I tried using the switch to alert method but I was just spitballing since I was pretty much stumped when it didn’t work the first time. Also as for the identification, the pop ups don’t have an ID or XPath, or am I wrong about this too?

Cheers for helping out.

If this isn't top secret, feel free to DM me the site and I can take a look
PM on its way.
 
Thanks again for replying. I have tried to fill it out when it pops up using selenium but the problem is I can’t treat it as a regular alert. I spent the better half of an evening reading documentation and still kept getting the “No such alert” error. Would you suggest that I handle the pop up as a different method?
If you see it then it's in html in some form, you just query elements in wrong way. Maybe it's iframe and you need to use someframe.find instead of page.find (I don't remember exactly how it was in selenium cos I use mostly puppeteer nowadays, but usually issues like you are caused by iframes that are not looked by selenium cos it looks only in main frame).
 
If you see it then it's in html in some form, you just query elements in wrong way. Maybe it's iframe and you need to use someframe.find instead of page.find (I don't remember exactly how it was in selenium cos I use mostly puppeteer nowadays, but usually issues like you are caused by iframes that are not looked by selenium cos it looks only in main frame).
You might be onto something with the iFrame thing. I might need to look a little bit deeper into that.

Cheers.
 
Back
Top