Authenticate method doesn’t detect BtnOK in a popup

Hi all. I’m having a problem with an authentication popup. I’m trying to use the “Authenticate” keyword, and it works fine with the “Username” and “Password” being filled in the popup, but then it is supposed to click on the “Accept” button, but doesn’t find it, so it’s showing following message in the log:

“Unable to navigate to authenticated page (Root cause: java.lang.Exception: Failed to click OK button on Authentication dialog: Object ‘BtnOK’ is not found)”

Visible options in the popup are “Log in” and “Cancel”.

The url is:

https://dev.mcdonalds.konoss.net/

How can I manage this? I’m using Chrome, but it doesn’t either work with Firefox. I can’t capture the id’s of the popup form neither with the record capabilities of Katalon nor the F12 developer tools from Chrome, so I don’t know how to interact with them.

Any advice would be greatly appreciated.

Hi everybody,

I am encountering the same sort of issue.
Trying to run a remote test case, the authentication step return this error : “FAILED because (of) Unable to navigate to authenticated page (Root cause: java.lang.Exception: Unsupported browser (only support IE, FF, Chrome))” whereas I am running it on a distant Chrome 59 on Win 10. I do not understand.

Any clue ?

Thanks a lot

Hi all
I am stuck at the exact same problem, also encountering the same response as Jon Robinson (being a Mac user:
"Unable to navigate to authenticated page (Root cause: java.lang.Exception: Unsupported platform (only support Windows). "
Is there a simple way to just dismiss the ‘Authentication Required’ popup?
It would be acceptable for me to simulate clicking the ‘Cancel’ button so the Authentication Required popup window can just go away.
Any suggestions welcome.
Many thanks

I got the same issue. I have error log (Unable to navigate to authenticated page (Root cause: java.lang.Exception: Failed to set user name on Authentication dialog: Object ‘TxtUserName’ is not found) for both ie and Firefox, “Unable to navigate to authenticated page (Root cause: java.lang.Exception: Failed to click OK button on Authentication dialog: Object ‘BtnOK’ is not found)” for chrome

Hi Vinh Nguyen

I tried your example, but got the following error:

Unable to navigate to authenticated page (Root cause: java.lang.Exception: Unsupported platform (only support Windows))

Any idea? I’m a MAC user :slight_smile:

Where shall I send it ? Thanks.

Hello guys,

I have the same issue as Alejandro. In my case, Katalon Studio is hanging after inputing login and pwd, and not even displaying an error in the logs.

I have tested your suggestion but:

Under Chrome 58, same result on your website sample (Katalon does input correctly login and pwd but can’t submit and hangs)
Under Firefox 53, login and pwd are not even input

Regards,

Of course, here is a screenshot of the popup:

Thank you very much in advance.

Hi everyone i’ve managed to come around this problem and to solve it using the java Robot with a custom keyword

`
import java.awt.Robot
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.awt.event.KeyEvent

public class Authenticate {
@Keyword
def loginAuthenticate(String username, String password) {
Robot robot = new Robot();
robot.setAutoDelay(250);
StringSelection ss = new StringSelection(username);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
ss = new StringSelection(password);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
}
}
`

You guys can also try this solution:
http://docs.katalon.com/display/KD/Using+autoIT+for+authentication+in+Katalon+Studio

Mark Fridman said:

Hi everyone i’ve managed to come around this problem and to solve it using the java Robot with a custom keyword

`

import java.awt.Robot

import java.awt.Toolkit

import java.awt.datatransfer.StringSelection

import java.awt.event.KeyEvent

public class Authenticate {

@Keyword

def loginAuthenticate(String username, String password) {

Robot robot = new Robot();

robot.setAutoDelay(250);

StringSelection ss = new StringSelection(username);

Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);

robot.keyPress(KeyEvent.VK_CONTROL);

robot.keyPress(KeyEvent.VK_V);

robot.keyRelease(KeyEvent.VK_V);

robot.keyRelease(KeyEvent.VK_CONTROL);

robot.keyPress(KeyEvent.VK_TAB);

robot.keyRelease(KeyEvent.VK_TAB);

ss = new StringSelection(password);

Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);

robot.keyPress(KeyEvent.VK_CONTROL);

robot.keyPress(KeyEvent.VK_V);

robot.keyRelease(KeyEvent.VK_V);

robot.keyRelease(KeyEvent.VK_CONTROL);

robot.keyPress(KeyEvent.VK_TAB);

robot.keyRelease(KeyEvent.VK_TAB);

robot.keyPress(KeyEvent.VK_ENTER);

robot.keyRelease(KeyEvent.VK_ENTER);

}

}

`

Thanks Mark! you resolved my problem.

Facing the same issue.
Please provide the solution.

Hi ,

Please see attach image for setting of test case.

1. Open Browser[Please don’t input any value]
2. Authenticate [URL,username,password,timeout]

katalon_authenticate_pop_up.jpg

Hello!

The same problem with Firefox and popup login window.

After this:

WebUI.openBrowser(GlobalVariable.url, FailureHandling.STOP_ON_FAILURE)
WS.delay(10)

Firefox opens window, then opens popup window. Popup window is visible.

But If I add any code, such as

WebUI.authenticate(GlobalVariable.url, 'login', 'pass', 1)

or ANY other - popup window immediately closes with exception in Log:

Test Cases/_Functions/Open URL FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Unable to navigate to authenticated page (Root cause: Unable to navigate to authenticated page)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)
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:53)
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 org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:149)
at Script1527590230607.run(Script1527590230607.groovy:28)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)

How can I do to prevent popup window closing?

Thank you!