Environment authentication

Ask general questions here.
tiffin.filion
Posts: 56
Joined: Thu Oct 29, 2020 12:47 am

Environment authentication

Post by tiffin.filion » Thu Dec 02, 2021 3:12 am

So...I have a ticket with Support but they can't see to provide an answer. So I'm reaching out to see if anyone else has run into this issue.

We test our website on multiple environments, and a few require authentication. There is no problem running it on my computer, but when we try to utilize browserstack, we can't get it to work ... since the popup is technically part of the browser and not part of the page itself.

I have tried so many things I have lost track but nothing seems to work. Adding username/password to the url doesn't work. And it's being blocked by browsers now anyway.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Environment authentication

Post by odklizec » Thu Dec 02, 2021 9:09 am

Hi,

Well, I'm afraid, webdriver cannot directly handle native browser dialogs. You will have to use some code to achieve what you want. Start with the code you already used here (to find the webDriverEndpoint):
viewtopic.php?f=15&t=20151&p=67582
And then try to adapt and apply the code suggested here:
https://www.browserstack.com/guide/aler ... n-selenium
Hope this helps? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

tiffin.filion
Posts: 56
Joined: Thu Oct 29, 2020 12:47 am

Re: Environment authentication

Post by tiffin.filion » Thu Dec 02, 2021 6:41 pm

Yah, I've tried to make the alert handling work.

So on iOS it works to clear a location notification popup, but won't when it's used for a username and a password. I get an error message saying that there are two fields. I even tried combining the username and password into a single sendKeys with a tab in between and it you can see from the browserstack screenshots that it isn't being filled in.

Android just doesn't want to work at all and says there is no alert.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Environment authentication

Post by odklizec » Fri Dec 03, 2021 8:37 am

Hi,

As far as I know, on Android, it should be possible to use Android ADB commands to handle this situation. Check for example this post:
https://riptutorial.com/android/example ... ce-via-adb
Unfortunately, I have nearly zero experience with ADB commands, but I believe they were discussed also here? And try also google for more examples ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

tiffin.filion
Posts: 56
Joined: Thu Oct 29, 2020 12:47 am

Re: Environment authentication

Post by tiffin.filion » Fri Dec 03, 2021 6:54 pm

Thank you! That should help get me on the right track. :)