# Star import statement.\* in a test case is regarded as error

**URL:** <https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638>\
**Category:** Bug Report\
**Tags:** bugs-report, katalon-studio\
**Created:** [January 13, 2019, 2:43am UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638 "2019-01-13T02:43:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [January 13, 2019, 2:43am UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638/1 "2019-01-13T02:43:29Z")

</div>

I have made a demo project where you can reproduce the problem:

- [junit4ks/Keywords/com/kazurayam/ksbackyard/junit/JUnitCustomKeywords.groovy at 1.0 · kazurayam/junit4ks · GitHub](https://github.com/kazurayam/RunningJUnitInKatalonStudio/blob/1.0/Keywords/com/kazurayam/ksbackyard/junit/JUnitCustomKeywords.groovy)

Please clone this project with tag 1.0

* * *

## Problem

Katalon Studio seems not accepting star import statement  
` import packageName.*`  
in a test case.

I created a test case [`Test Cases/StarImportProblemReport`](https://github.com/kazurayam/RunningJUnitInKatalonStudio/blob/1.0/Scripts/test/StarImportProblemDemo/Script1547302275589.groovy)

```auto
import junittutorial.*

CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(CalculatorTest.class)

CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(GreeterTest.class)

```

When I ran, I got error:

 ![16](https://europe1.discourse-cdn.com/katalon/original/2X/5/5e9e2704dfbfae9ae7020f53109bfa4fab25d674.png)  
Error dialog says:

```auto
There are errors in the script. Please fix before executing.

```

## What I investigated

When I change the test case as follows, it ran successful.

```auto
import junittutorial.Calculatortest
import junittutorial.GreeterTest

CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(CalculatorTest.class)

CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(GreeterTest.class)

```

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [January 21, 2019, 1:55am UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638/2 "2019-01-21T01:55:21Z")

</div>

In script mode, I edited a test case scritp. I commented out indivisual import statements, and add a star import statement.

```auto
/*
import com.kazurayam.ksbackyard.AssertTest
import com.kazurayam.ksbackyard.ImageCollectionDifferTest
import com.kazurayam.ksbackyard.ImageDifferenceTest
import com.kazurayam.ksbackyard.RunConfigurationWrapperTest
import com.kazurayam.ksbackyard.QuietBrowserTest
import com.kazurayam.ksbackyard.ScreenshotDriverTest
import com.kazurayam.ksbackyard.ScreenshotDriverCompareImagesTest
import com.kazurayam.ksbackyard.TestObjectSupportTest
import com.kazurayam.ksbackyard.URLParserTest
import com.kazurayam.ksbackyard.VersionTest
*/
import com.kazurayam.ksbackyard.*

CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(AssertTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(ImageCollectionDifferTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(ImageDifferenceTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(QuietBrowserTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(RunConfigurationWrapperTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(ScreenshotDriverTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(ScreenshotDriverCompareImagesTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(TestObjectSupportTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(URLParserTest.class)
CustomKeywords.'com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner'(VersionTest.class)

```

When I tried to save it, I got the following error dialog.

 ![PleaseFixThemBeforeSwitchingToManualMode](https://europe1.discourse-cdn.com/katalon/original/2X/9/956915ff41a7476357163a6e972deffe0ad692c7.png)

```auto
There are errors in the script. Please fix them before switching to manual mode.

```

A new clue is given here: **manual mode**

What I guess: the Manual mode has some dependencies on entries in the CLASSPATH. The Manual mode depends on the class binaries of Custom Keywords, but it does not suppose to be dependent on the class binaries generated by \*.groovy files located in the `Includes/scripts/groovy`. Therefore the Manual mode can not search for binaries of `com.kazurayam.ksbackyard.*` which are located in the the `Includes/scripts/groovy`.

I presume Katalon GUI, especiall the Test Case editor of Manual mode, should be reviewed to cooperate with the build-path `Include/scripts/groovy`.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/katalon/original/3X/d/5/d55596ab02785a255798e87ede769734747b30c4.svg) [@system](https://forum.katalon.com/u/system)\
**Post date:** [January 19, 2020, 7:46am UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638/3 "2020-01-19T07:46:10Z")

</div>



---

<div class="post-metadata">

**Author:** ![huynguyen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/huynguyen/32/552_2.png) [@huynguyen](https://forum.katalon.com/u/huynguyen)\
**Post date:** [January 19, 2020, 4:09pm UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638/4 "2020-01-19T16:09:44Z")

</div>

Hi @kazurayam,  
Please download the latest version of Katalon Studio and try again.

---

<div class="post-metadata">

**Author:** ![abennett](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@abennett](https://forum.katalon.com/u/abennett)\
**Post date:** [February 20, 2020, 11:19pm UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638/5 "2020-02-20T23:19:18Z")

</div>

I was having this same issue in version 7.0.1, but it appears to have been resolved by at least version 7.2.1

Thanks for the update reminder, @huynguyen

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2021, 11:19pm UTC](https://forum.katalon.com/t/star-import-statement-in-a-test-case-is-regarded-as-error/17638/6 "2021-02-19T23:19:22Z")

</div>

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
