Windows authentication

I have an issue regarding windows authentication in my web applications.i have mentioned the code as WebUI.authenticate(‘URL’,‘Username’,‘Password’,Timeout which i mentioned as 12). When I run the code , its navigating to the home page but after that its stucks showing following error “Test Cases/New Test Case FAILED because (of) Unable to navigate to authenticated page (Root cause: Unable to navigate to authenticated page)”.

1 Like

Having the exact same issue… I would really appreciate any help at this.

1 Like

I’m able to run test cases on an internal web app with Windows Auth without calling WebUI.authenticate – I just call WebUI.navigateToUrl(‘http://test.ourlocalapp.com/’) and it opens up as the user who’s running Katalon. Are you using WebUI.authenticate to log in as a different user?

I have the same issue here. Really need some help and solution, thank you!

I have a small web appilcation using the only the default windows authentication of IIS in Win10 and have an issue with FF. In Chrome the test can authenticate and run all needed steps, but in FF it fails for the authentication step.

Also to succeed with Chrome I had to set "FailureHandling.CONTINUE_ON_FAILURE)
" for the “Authenticate” function. I guess that’t not the intended way to run w eb application using default windows authentication.

Does anybody know a workaround, or is there any other function or setting as “Authenticate” to logon successfully using the default IIS windows authentication?

Sascha Cappel said:

I have a small web appilcation using the only the default windows authentication of IIS in Win10 and have an issue with FF. In Chrome the test can authenticate and run all needed steps, but in FF it fails for the authentication step.

Also to succeed with Chrome I had to set "FailureHandling.CONTINUE_ON_FAILURE)
" for the “Authenticate” function. I guess that’t not the intended way to run w eb application using default windows authentication.

Does anybody know a workaround, or is there any other function or setting as “Authenticate” to logon successfully using the default IIS windows authentication?

My site uses a popup window that I believe is the default authentication for IIS in Win 10 (running on chrome though) that webui.authenticate was having problems with. I use some custom javascript which opens the page, then a customkeyword script which does the authentication. Maybe some of this will work for you.

Heres the javascript call you make in the test case:

WebUI.executeJavaScript('function myFunction() { setTimeout(function(){ window.location.href = \'https://domainurl.com'; }, 500);}; myFunction()', [])

And here’s the custom keyword part

Call in test case:

CustomKeywords.'auth_package.auth_keyword.loginAuthenticate'(Username, Password)

which executes the keyword ‘auth_package’:

package auth_packageimport static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpointimport static com.kms.katalon.core.testcase.TestCaseFactory.findTestCaseimport static com.kms.katalon.core.testdata.TestDataFactory.findTestDataimport static com.kms.katalon.core.testobject.ObjectRepository.findTestObjectimport com.kms.katalon.core.annotation.Keywordimport com.kms.katalon.core.checkpoint.Checkpointimport com.kms.katalon.core.checkpoint.CheckpointFactoryimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywordsimport com.kms.katalon.core.model.FailureHandlingimport com.kms.katalon.core.testcase.TestCaseimport com.kms.katalon.core.testcase.TestCaseFactoryimport com.kms.katalon.core.testdata.TestDataimport com.kms.katalon.core.testdata.TestDataFactoryimport com.kms.katalon.core.testobject.ObjectRepositoryimport com.kms.katalon.core.testobject.TestObjectimport com.kms.katalon.core.webservice.keyword.WSBuiltInKeywordsimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywordsimport internal.GlobalVariableimport MobileBuiltInKeywords as Mobileimport WSBuiltInKeywords as WSimport WebUiBuiltInKeywords as WebUIimport java.awt.Robotimport java.awt.Toolkitimport java.awt.datatransfer.StringSelectionimport java.awt.event.KeyEventimport java.awt.MouseInfoimport java.awt.Pointimport java.awt.PointerInfoimport java.awt.event.InputEventimport java.awt.datatransfer.Clipboard;import java.awt.datatransfer.DataFlavor;public class auth_keyword {	@Keyword	def loginAuthenticate(String username, String password) {		Robot robot = new Robot();		robot.setAutoDelay(350);		StringSelection ss = new StringSelection(username);		Toolkit toolkit = Toolkit.getDefaultToolkit()		Clipboard clipboard = toolkit.getSystemClipboard().setContents(ss, null);		robot.delay(2000);		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);	}}


1 Like

I’ve been using the solution described here and it’s worked well for me: