AI error when using import API feature

I am using version 10.2.0 of the studio
I am importing an openapi 3 file which imports correctly.
After the import is complete I get a popup to use AI to create the test scripts and I said yes.
It starts but then I get the error message “Errors have occurred when generation test scripts” with no other information. How do I get additional information?

1 Like

To troubleshoot the AI test generation error in Katalon Studio 10.2.0 and retrieve additional details, follow these steps:

1. Check Katalon Studio Logs

  • Log Location:
    • Navigate to your Katalon project folder → Logslog.html or log.txt.
    • Check the Console Output in Katalon Studio during test generation (bottom panel).
  • Action: Look for errors mentioning “GenAI,” “AI test generation,” or network issues. Example keywords: HTTP 4xx/5xx, Invalid API key, or Failed to connect.

2. Validate Your OpenAPI 3.0 File

  • Even if Katalon imports the file, subtle issues (e.g., circular references, unsupported fields) can break AI generation.
  • Tools:
  • Fix: Resolve any warnings/errors, especially in endpoints you want to test.

3. Test with a Minimal OpenAPI File

  • Create a simple OpenAPI file with one endpoint (e.g., GET /health) to isolate the issue. If AI works here, your original file likely has schema incompatibilities.

4. Check Network and GenAI Connectivity

  • Katalon’s AI test generation relies on cloud-based services. Ensure:
    • No firewall/proxy is blocking Katalon Studio.
    • You have an active internet connection.
    • Your Katalon account has a valid license for AI features (Enterprise plan required).

5. Verify GenAI Configuration

  • Ensure GenAI is enabled and configured:
    1. Go to Project Settings → Katalon AI → Enable Test Generation with GenAI.
    2. Verify your API key (if required) under Katalon AI settings.

6. Update Katalon Studio

  • Check for Updates:
    • Go to Help → Check for Updates.
    • Upgrade to the latest version (e.g., 10.2.x) to fix potential bugs.

7. Enable Debug Logging

  • Launch Katalon Studio with verbose logging:
    • Command Line:
katalon --args -consoleLog -debug
  • Review the console for detailed errors during AI test generation.

8. Contact Katalon Support

  • If unresolved, provide the following to Katalon Support:
    • log.html and console output.
    • Your OpenAPI file (if possible).
    • Steps to reproduce the issue.

9. Manual Workaround

  • Generate tests without AI:
    1. Right-click your API object → Generate Test Cases.
    2. Use the New Test Case wizard to build tests manually.

By following these steps, you can identify issues related to your OpenAPI schema, network connectivity, or software configuration.

o “Navigate to your Katalon project folder → Logslog.html or log.txt.”

The logs folder and the log files cannot be found

In the Katalon Studio’s tool bar, choose “Help” > “Error Log”

Then the .log file will open in a text editor.

I believe that the .log contains a Java Stack Trace message that tells the exact reason of the message “Errors have occured when generation test scripts”. That would help Katalon to try to fix this problem.

Please attach the entire body of .log here; do not trim it at all.

I have imported a collection from postman into Katalon, but how do I import all the environment variables.

I have 3 testing env., and json string for each with approx. 20 variables, How do I get those into Katalon?

? I don’t understand your question. Please explain more clearly.

There was no text where “an error message“ was mentioned.

However ,I did a re-import, and this showed at the end of log

!ENTRY org.eclipse.ui 4 0 2025-05-13 10:00:15.459

!MESSAGE Unhandled event loop exception

!STACK 0

java.lang.NullPointerException: Cannot invoke “java.lang.Integer.intValue()” because the return value of “com.kms.katalon.core.util.ObjectUtil.getField(Object, String)” is null

at com.kms.katalon.composer.components.util.StyleUtil.isDefaultBackground(StyleUtil.java:45)

at com.kms.katalon.composer.components.util.StyleUtil.updateChildrenBackground(StyleUtil.java:269)

at com.kms.katalon.composer.components.util.StyleUtil.updateChildrenBackground(StyleUtil.java:276)

at com.kms.katalon.composer.components.util.StyleUtil$1.paintControl(StyleUtil.java:65)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:247)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4285)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1160)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1184)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1169)

at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1631)

at org.eclipse.swt.widgets.Control.windowProc(Control.java:4769)

at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)

at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3671)

at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)

at org.eclipse.jface.window.Window.open(Window.java:799)

at com.kms.katalon.composer.webservice.handlers.ImportOpenApiHandler.execute(ImportOpenApiHandler.java:163)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:569)

at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)

at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:299)

at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:233)

at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)

at org.eclipse.e4.ui.workbench.renderers.swt.DirectContributionItem.executeItem(DirectContributionItem.java:133)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:442)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:464)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4285)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1160)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4083)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3673)

at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)

at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)

at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)

at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)

at com.kms.katalon.core.application.WorkbenchApplicationStarter.start(WorkbenchApplicationStarter.java:23)

at com.kms.katalon.application.Application.runGUI(Application.java:209)

at com.kms.katalon.application.Application.start(Application.java:114)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:569)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)

at org.eclipse.equinox.launcher.Main.run(Main.java:1481)”