# \[WebUI\] Authenticate

**URL:** <https://forum.katalon.com/t/webui-authenticate/16605>\
**Category:** Miscellaneous\
**Tags:** new-doc-request\
**Created:** [January 4, 2019, 8:29am UTC](https://forum.katalon.com/t/webui-authenticate/16605 "2019-01-04T08:29:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/katalon/original/3X/d/5/d55596ab02785a255798e87ede769734747b30c4.svg) [@system](https://forum.katalon.com/u/system)\
**Post date:** [January 4, 2019, 8:29am UTC](https://forum.katalon.com/t/webui-authenticate/16605/1 "2019-01-04T08:29:25Z")

</div>

* * *
This is a companion discussion topic for the original entry at [https://docs.katalon.com/katalon-studio/docs/webui-authenticate.html](https://docs.katalon.com/katalon-studio/docs/webui-authenticate.html)

---

<div class="post-metadata">

**Author:** ![amrendra1](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@amrendra1](https://forum.katalon.com/u/amrendra1)\
**Post date:** [March 14, 2019, 7:31am UTC](https://forum.katalon.com/t/webui-authenticate/16605/2 "2019-03-14T07:31:54Z")

</div>

I tried basic authentication method and it is not working on my site it is working on website mention in script

---

<div class="post-metadata">

**Author:** ![lbk](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/lbk/32/3134_2.png) [@lbk](https://forum.katalon.com/u/lbk)\
**Post date:** [March 19, 2019, 8:30pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/3 "2019-03-19T20:30:47Z")

</div>

Does the authenticate keyword require that the login be in a dialogue box rather than part of a web page?

It’s not working for me on a page that is a login screen.

---

<div class="post-metadata">

**Author:** ![Perun](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/perun/32/3223_2.png) [@Perun](https://forum.katalon.com/u/Perun)\
**Post date:** [March 21, 2019, 11:29am UTC](https://forum.katalon.com/t/webui-authenticate/16605/4 "2019-03-21T11:29:03Z")

</div>

same problem here, authenticate does not work ☹

always getting same error:

Reason:  
com.kms.katalon.core.exception.StepFailedException: Unable to navigate to authenticated page  
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:48)  
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)  
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)  
at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.authenticate(AuthenticateKeyword.groovy:49)  
at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.execute(AuthenticateKeyword.groovy:42)  
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)  
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.authenticate(WebUiBuiltInKeywords.groovy:2687)  
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$authenticate$0.call(Unknown Source)  
at NGAuthLogin.run(NGAuthLogin:25)  
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)  
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)  
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:331)  
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)  
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)  
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)  
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)  
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)  
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)  
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)  
at TempTestCase1553163100585.run(TempTestCase1553163100585.groovy:21)

Edit:  
saw this on other forums and this helped me:

WebUI.openBrowser(’’)

WebUI.authenticate(‘URL’, ‘user’, ‘pass’, 12, FailureHandling.OPTIONAL)

it will not get you pass result but will move past the error and you will still be able to run your tests further.

---

<div class="post-metadata">

**Author:** ![potato](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@potato](https://forum.katalon.com/u/potato)\
**Post date:** [March 29, 2019, 4:44pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/5 "2019-03-29T16:44:11Z")

</div>

Can other forms of authentication be used, such as browser-loaded PKI/SSL certificates?

---

<div class="post-metadata">

**Author:** ![jozef.szymala](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jozef.szymala](https://forum.katalon.com/u/jozef.szymala)\
**Post date:** [June 5, 2019, 6:41pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/6 "2019-06-05T18:41:19Z")

</div>

Guys try this, it is small walkaround but it is pretty useful 🙂

WebUI.navigateToUrl(‘[https://usernam:password@www.demo.io/](https://usernam:password@www.demo.io/)’)

---

<div class="post-metadata">

**Author:** ![bnaik](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@bnaik](https://forum.katalon.com/u/bnaik)\
**Post date:** [June 12, 2019, 4:38pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/7 "2019-06-12T16:38:44Z")

</div>

I see many of them had an issue with using the WebUI.authenticate() method.  
You could get past the authentication but you could still see the error ‘Unable to navigate to the given url’

This got solved on adding a delay ,i.e. WebUI.delay(5) after the authenticate step.  
Once i added this delay the script continued execution and passed all the verification i had for the page.

---

<div class="post-metadata">

**Author:** ![jayeshL](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@jayeshL](https://forum.katalon.com/u/jayeshL)\
**Post date:** [June 13, 2019, 8:43am UTC](https://forum.katalon.com/t/webui-authenticate/16605/8 "2019-06-13T08:43:37Z")

</div>

Thanks, It is working 🙂

---

<div class="post-metadata">

**Author:** ![maxsudik](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/maxsudik/32/1194_2.png) [@maxsudik](https://forum.katalon.com/u/maxsudik)\
**Post date:** [October 8, 2019, 9:10pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/9 "2019-10-08T21:10:07Z")

</div>

The issue is still valid for me  
I tried straightforward method and workarounds. So this is what I tried

1. WebUI.navigateToUrl(‘[https://LOG:PASS@ULR](https://LOG:PASS@ULR)’)

2. WebUI.authenticate(‘URL’, ‘LOG’, ‘PASS’,  
5, FailureHandling.OPTIONAL)

3. I even used both ‘navigateToUrl’ and ‘authenticate’ methods in the same test case

4. I used delays before and after each step

This is the log

```
> 10-08-2019 02:04:26 PM authenticate("https:// ***", "***", "***", 5, OPTIONAL)
> 
> Elapsed time: 0.172s
> 
> Unable to navigate to authenticated page (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to navigate to authenticated page
> at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
> at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.authenticate(AuthenticateKeyword.groovy:49)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.execute(AuthenticateKeyword.groovy:42)
> at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
> at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.authenticate(WebUiBuiltInKeywords.groovy:2670)
> at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$authenticate$0.call(Unknown Source)
> at Login To Training ENV.run(Login To Training ENV:23)
> at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
> at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
> at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
> at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
> at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
> at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
> at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
> at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
> at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
> at TempTestCase1570568655546.run(TempTestCase1570568655546.groovy:21)
> Caused by: org.openqa.selenium.InvalidArgumentException: invalid argument
> (Session info: chrome=77.0.3865.90)
> Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
> System info: host: 'AVW010', ip: '142.32.18.87', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
> Driver info: com.kms.katalon.selenium.driver.CChromeDriver
> Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 77.0.3865.90, chrome: {chromedriverVersion: 76.0.3809.68 (420c9498db8ce..., userDataDir: C:\Users\maxs\AppData\Local...}, goog:chromeOptions: {debuggerAddress: localhost:33184}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
> Session ID: 4961411c15011ab09d29bd764c060956
> at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
> at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
> at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
> at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
> at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
> at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
> at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:20)
> at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:277)
> at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:857)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.isNavigateOnChromeFirefoxSuccess(AuthenticateKeyword.groovy:102)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword$_authenticate_closure1.doCall(AuthenticateKeyword.groovy:79)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword$_authenticate_closure1.call(AuthenticateKeyword.groovy)
> at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.authenticate(AuthenticateKeyword.groovy:49)
> at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword.execute(AuthenticateKeyword.groovy:42)
> at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
> at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.authenticate(WebUiBuiltInKeywords.groovy:2670)
> at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$authenticate$0.call(Unknown Source)
> at Script1570563058583.run(Script1570563058583.groovy:23)
> ... 10 more
> )
```

---

<div class="post-metadata">

**Author:** ![chad](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@chad](https://forum.katalon.com/u/chad)\
**Post date:** [October 14, 2019, 2:18am UTC](https://forum.katalon.com/t/webui-authenticate/16605/10 "2019-10-14T02:18:05Z")

</div>

Just in case this helps someone else…

I just ran into this exact error. For my particular case, I figured out that it has to do with the fact that the site is redirecting to a new url after authentication. For some reason this is throwing the error. To fix this, I changed the url parameter for WebUI.authenticate to be the url it redirects to after successful authentication. Now the test runs start to finish with no problems.

---

<div class="post-metadata">

**Author:** ![mariana.kolko](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mariana.kolko](https://forum.katalon.com/u/mariana.kolko)\
**Post date:** [October 17, 2019, 9:17am UTC](https://forum.katalon.com/t/webui-authenticate/16605/11 "2019-10-17T09:17:51Z")

</div>

hello @chad note that i’m still facing the error “Unable to navigate to authenticated page”, i tried to change the URL as advised by you, but no success. can you please advise

---

<div class="post-metadata">

**Author:** ![mariana.kolko](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mariana.kolko](https://forum.katalon.com/u/mariana.kolko)\
**Post date:** [October 17, 2019, 9:18am UTC](https://forum.katalon.com/t/webui-authenticate/16605/12 "2019-10-17T09:18:57Z")

</div>

@jayeshL can you advise please what you did to get it work, since i’m keep getting “Unable to navigate to authenticated page”

---

<div class="post-metadata">

**Author:** ![stano.pozgay](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@stano.pozgay](https://forum.katalon.com/u/stano.pozgay)\
**Post date:** [November 21, 2019, 10:45am UTC](https://forum.katalon.com/t/webui-authenticate/16605/13 "2019-11-21T10:45:59Z")

</div>

Hello, I would like to set my password in authenticate as encrypted text or invisible for other users how can I do it? Is there any option for this case?

---

<div class="post-metadata">

**Author:** ![sharmilah.devi](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sharmilah.devi](https://forum.katalon.com/u/sharmilah.devi)\
**Post date:** [December 13, 2019, 8:59am UTC](https://forum.katalon.com/t/webui-authenticate/16605/14 "2019-12-13T08:59:04Z")

</div>

hi all, i have face the same issue but then i manage to fix it…this is the method how i did it.  
Steps 1:  
in your open browser script give the credential as this:  
WebUI.openBrowser(‘http:// **USERNAME:PASSWORD** @example.com’)  
Step 2:  
Now navigate the url as this:  
WebUI.navigateToUrl(‘[http://xxx@example.com](http://xxx@example.com)’)

That’s it now save and run…hopefully it will help you

---

<div class="post-metadata">

**Author:** ![dietrich](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dietrich/32/4771_2.png) [@dietrich](https://forum.katalon.com/u/dietrich)\
**Post date:** [February 10, 2020, 7:22am UTC](https://forum.katalon.com/t/webui-authenticate/16605/15 "2020-02-10T07:22:25Z")

</div>

That did the trick. I got redirected to /site/login and after i extended my global variable with this, i got no error when i use WebUI.authenticate. Thank you! 👍

---

<div class="post-metadata">

**Author:** ![jkavungal](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jkavungal](https://forum.katalon.com/u/jkavungal)\
**Post date:** [April 16, 2020, 11:43am UTC](https://forum.katalon.com/t/webui-authenticate/16605/16 "2020-04-16T11:43:04Z")

</div>

Did not work for me.

Tried all three methods, authenticate(), navigateToUrl and openBrowser.

One thing to highlight is, the user id i tried was having domain portion and a period.  
For example : [domain.com](http://domain.com)\user.one

Errors ass below:

# When used authenticate:

Unable to navigate to authenticated page (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to navigate to authenticated page.

# When used navigatetourl:

Unable to navigate to ‘[http://domain.com\user.one:passw#ord@192.111.111.239/main.aspx](http://domain.com%5Cuser.one:passw#ord@192.111.111.239/main.aspx)’

# When used opeenbrowser:

Unable to open browser with url: ‘[http://domain.com\user.one:passw#ord@192.111.111.239/main.aspx](http://domain.com%5Cuser.one:passw#ord@192.111.111.239/main.aspx)’

---

<div class="post-metadata">

**Author:** ![jkavungal](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jkavungal](https://forum.katalon.com/u/jkavungal)\
**Post date:** [April 16, 2020, 11:59am UTC](https://forum.katalon.com/t/webui-authenticate/16605/17 "2020-04-16T11:59:03Z")

</div>

Ok… got it worked for me now.  
I just had to replace the “” with url encoded value “%5C”. And it worked for me.  
happy me…

---

<div class="post-metadata">

**Author:** ![david.tegeler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/david.tegeler/32/16103_2.png) [@david.tegeler](https://forum.katalon.com/u/david.tegeler)\
**Post date:** [May 5, 2020, 1:20pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/18 "2020-05-05T13:20:15Z")

</div>

I need to have my url to be a variable because I need to use the automation test case in more than one environment. I tried using a variable on the Open Browser as follows [http://userName](http://userName):Password@GlobalVariable.Staging\_URL. This does not work it goes to open the browser and inserts the url as GlobalVariable.Staging\_URL Can someone help me use this method so I can have it look at the variable? Also I would prefer to use the other method. As originally described in this document for the WebUI Authenticate. It it’s more versatile and works fine. It seems that it needs a bug fix for the the fail response. Why would you return a fail when it is successful?

---

<div class="post-metadata">

**Author:** ![danzaaa981](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@danzaaa981](https://forum.katalon.com/u/danzaaa981)\
**Post date:** [May 6, 2020, 11:46am UTC](https://forum.katalon.com/t/webui-authenticate/16605/20 "2020-05-06T11:46:47Z")

</div>

It probably should work like this i think.  
I dont have an environment right now where i can test this…  
But it should attach the URL to the String.  
Please let me know if it worked…

WebUI.openBrowser(“http:// **USERNAME:PASSWORD** @”+GlobalVariable.Staging\_URL)

---

<div class="post-metadata">

**Author:** ![david.tegeler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/david.tegeler/32/16103_2.png) [@david.tegeler](https://forum.katalon.com/u/david.tegeler)\
**Post date:** [May 7, 2020, 5:44pm UTC](https://forum.katalon.com/t/webui-authenticate/16605/21 "2020-05-07T17:44:21Z")

</div>

Here is what I ended up with, and then it worked. WebUI.openBrowser(((((‘http://’ + GlobalVariable.userName) + ‘:’) + GlobalVariable.Password) + ‘@’) + GlobalVariable.URL)

Your suggestion got me started in the right direction though, so thanks for your help!

[Next page](https://forum.katalon.com/t/webui-authenticate/16605.md?page=2)
