Using autoIT for authentication in Katalon Studio
WebUI.authenticate keyword in Katalon Studio would work well on Firefox browser, but the function might not work on other browsers due to unknown reasons. This guide will provide you a workaround solution for handling authentication on different browsers is using autoIT.
This would be applicable for Chrome, Firefox and Edge.
Get the latest version of Katalon Studio: https://www.katalon.com/
Install autoIT (Autoit Full Installation and AutoIt Script Editor) at https://www.autoitscript.com/site/autoit/downloads/
3. Steps Details:
- Working with AutoIt file:
Proceed to edit credential to your own account:
Open autoIt Script Editor (SciTE)
Open (or create new) autoit file with contents:
Change your own credential at "Username" and "Password" fields
WinFlash("", "Authentication Required",4,500)
If WinExists("","Authentication Required") Then
ElseIf WinExists("","Chrome Legacy Window")Then
ElseIf WinExists("","Windows Security") Then
Save this file to your desired location. You would have a file with *au3 format. Right click on file and select "Compile Script" option to create .exe file.
b. Adding steps to call autoIt (*.exe) file in Katalon Studio Script Mode
autoit_prj = '[your_autoit_file_path].exe'
WebUI.navigateToUrl('Your test site url')
//Sample path. Change it to your saved location of autoIT script
autoit_prj = 'D:\\PS-Katalon\\AutoIT\\Authentication_Custom.exe'
//Sample URL. Please change it to your authentication URL
Now it's all done. You can run your test case to see how it works.