Authentication - unable to navigate to authenticated page

When using ‘WebUI.authenticate(URL, username, password, 5)’ the Login-PopUp is successfully filled with the username and password and the page is loaded.

But the execution stops and I get the following error message:
‘FAILED because (of) Unable to navigate to authenticated page (Root cause: Unable to navigate to authenticated page)’

But the page that I wnated to access is load, the script could just continue with the next steps? I checked if I have navigateToUrl twice somewhere but thats not the case.

Any help appreciated.

3 Likes

I have the same issue here

I also found the same problem. I tried changing the timeout to 60 seconds, but it still failed my test case and did not continue with the rest of the script.

I added failureHandling.OPTIONAL to the authenticate method and it worked. This skews my test results a bit, but it works.

WebUI.authenticate(baseURL, ‘username’, ‘password’, 60, FailureHandling.OPTIONAL)

You can also use AutoIT to Authenticate for you. See this thread:
https://docs.katalon.com//display/KD/Using+autoIT+for+authentication+in+Katalon+Studio

5 Likes

This not really a satisfaying way to deal with authentication… And I don’t know about you, guys, but here, all of our working environments are behind Basc Auth. So the Authentication keyword is a must-have.
By the way, it could be great if the credentials could have been inserted in the HTTPHeader and not in the URL…

Agreed, it’s not always perfect. If you are looking to alter the HTTP header, take a look at this thread:
http://forum.katalon.com/discussion/4432/how-to-modify-request-headers-while-using-chrome-for-running-testcases.

Hopefully this will help

With the current version 3.9.1 this problem still occurs. You still need the FailureHandling workaround described above by Charles Brown.

@Katalon Studio team: Do you plan to fix this?

Why there is no news about this, I’m struggling to pass through the authentication popup and nothing works. I tried WebUI.authentication, WebUI.openBrowser(“http://username:password@WebsiteURL”) I used Web.setAlertText etc. etc. nothing works. The internet is full with this problem and Katalon doesn’t seem to care (as you can see no answer from a year ago). I started to really hate this tool - Cypress is much better

2 Likes

WebUI.authenticate(baseURL, ‘username’, ‘password’, 60, FailureHandling.OPTIONAL)

It does not work if the prompted login popup is from Windows IIS authentication. Apparently it requires some custom stuff like: Katalon Studio Native Popup Window and Upload File

@gordanmircea Which browser are you using Chrome/ IE?
How you handle the same in Cypress.

In Cypress it was very easy, just need to add an auth header and works like a charm (see bellow). With Katalon I tried with both Chrome and Firefox, but because that pop-up is not a web element it is not recognized and apparently Katalon doesn’t have the capability of sending and auth header request for opening an URL.

cy.visit(‘URL’,{
auth: {
username: ‘string’,
password: ‘string’
}
)}

1 Like

Could you please share your test URL.

The below is sample URL with Windows Authentication popup. Please check if it is working in Chrome browser for you. I have no success with Firefox.

http://admin:admin@the-internet.herokuapp.com/basic_auth

AUTHEN%202

// Method -1 (Works in Chrome only)
 WebUI.openBrowser('http://admin:admin@the-internet.herokuapp.com/basic_auth')
// Method -2
WebUI.openBrowser('')
WebUI.authenticate('http://the-internet.herokuapp.com/basic_auth', 'admin', 'admin', 10, FailureHandling.OPTIONAL)
1 Like

I have the same. I tried with both Firefox and Chrome and it is not working. Did not find an easy solution to this. Like I said it needs some custom keywords to be made and some headaches. But I’m very new with Katalon I’m just trying to make a POC with it - Cypress is more intuitive and flexible (for me at least, I might be subjective here)

Could you please share your test URL.

No I can’t sorry. It is confidential, working just in intranet :frowning:

Is this URL working in your machine: http://admin:admin@the-internet.herokuapp.com/basic_auth

Yes - no auth requested

Hello, any update on the above, since i’m facing the same issue. i’m trying to navigate to dynamics 365 URL. but when replaying the recorded steps, the URL isn’t even displayed, and the window of the username and password isn’t appearing

1 Like

The first method helps me to solve the problem. Thank you!

@julia.nastenko Please try adding the FailureHandling.OPTIONAL as mentioned below

// Method -2
WebUI.openBrowser('')
WebUI.authenticate('http://the-internet.herokuapp.com/basic_auth', 'admin', 'admin', 10, FailureHandling.OPTIONAL)