How to set text to the dialog box which doesn't have xpath

I got the web link in which we need to set the details in the dialog box. Every time I need to key the logon details manually. Is there any way to do it automatically.

Try this:

Here is the example:

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

Thanks for your reply. But I’m still getting getting the error.image
image

I need to see your code.

I need to see your the complete error message.

05-23-2021 10:59:00 AM authenticate(“https://”, “userId”, “password”, 30, OPTIONAL)

Elapsed time: 12.514s

Unable to navigate to authenticated page (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to navigate to authenticated page. Reason:
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailedWithReason(WebUIKeywordMain.groovy:70)
at com.kms.katalon.core.webui.keyword.builtin.AuthenticateKeyword$_authenticate_closure1.doCall(AuthenticateKeyword.groovy:91)
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:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.authenticate(WebUiBuiltInKeywords.groovy:2670)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$authenticate$1.call(Unknown Source)
at TXQ logon.run(TXQ logon:24)
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.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:169)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1621763905754.run(TempTestSuite1621763905754.groovy:36)
)

Sorry, I have no idea what’s going on there. Let’s see if these guys can help:

@kazurayam @bionel @grylion54
@ThanhTo @duyluong

Don’t call WebUI.navigateToUrl() before authenticate().

Currently you do:

WebUI.openBrowser(...)
WebUI.navigateToUrl("url string")
WebUI.authenticate("url string")

You should rather do:

WebUI.openBrowser(...)
WebUI.authenticate("url string")

@kazurayam
Thanks for your reply, but it not working

Which Browser are you using?

The source of WebUI.authenticate() keyword at here. I noticed that this keyword works only for Chrome, Firefox and IE. It would not work for other browsers, such as Safari, Edge.

Also it is possible that recent versions of Chrome, FireFox has changed to be more and more strict about security. Therefore the WebUI.authenticate() keyword may loose power against newer versions of browsers.

How to cheat browsers for authentication using Selenium — this problem is a cat-and-mouse game.

A classic approach to pass Basic Authentication is to insert username and password in the URL string.

WebUI.navigateToUrl("https://username:password@hostname/some/path")

@kazurayam Thanks. The classic approach is worked, but when I navigate to next page from the home page the new page is not loading correctly
Home page


Next page load by selecting options from file menu

Congrats! Perhaps you found a bug of your AUT!

You should report what you found to your development team, not to the Katalon Forum.

@kazurayam When authenticate the url manually the next page loads fine I can able proceed the next steps without any problem. I think due to some security reason I can’t able to authenticate the url using keyword. Anyway thanks for help