java.lang.SecurityException, error

I am getting this error when I am using the katlon studio enterprise version 9.6.0

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Hi @bisandi.jayasundera,

Can you please try some of the following suggestions: com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFile was failed (Root cause: java.lang.SecurityException: class "module-info"'s signer information does not match signer information of other classes in the same package - #6 by Elly_Tran?

Hi @Elly_Tran
I tried these as well, but still I am receiving the same error msg.

Hi,

Can I ask for more context from your test: is that bdd project, your testing feature, your OS, your KS version, …?

Hi Elly,

Im doing this BDD project to check in a log in functionality, and I’m using the Windows 10 Enterprise OS version. My Katalon Version is “katalon studio enterprise version 9.6.0”

Hi @bisandi.jayasundera,

Sorry for my late response. Can you replace current code in TestListener by below code as a workaround solution or try download workaround project attached? The fix is planned in v9.7.0. Thank you!

import org.apache.commons.lang3.SystemUtils

import com.kms.katalon.core.annotation.BeforeTestCase
import com.kms.katalon.core.annotation.BeforeTestSuite
import com.kms.katalon.core.context.TestSuiteContext
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords

class TestListener {
	/**
	 * Executes before every test suite starts.
	 * @param testSuiteContext: related information of the executed test suite.
	 */
	
	@BeforeTestCase
	def sampleBeforeTestCase(TestSuiteContext testSuiteContext) {
		addDefaultPackages()
	}
	private static void listOfPackage(String directoryName, Set<String> pack) {
		File directory = new File(directoryName);
		// get all the files from a directory
		File[] fList = directory.listFiles();
		for (File file : fList) {
			if (file.isFile()) {
				String path = file.getPath();
				String prefixPath = SystemUtils.IS_OS_WINDOWS ? "Include\\scripts\\groovy" : "Include/scripts/groovy";
				String packName = path.substring(path.lastIndexOf(prefixPath), path.lastIndexOf(File.separator));
				pack.add(packName.replace(File.separator, '.'));
			} else if (file.isDirectory()) {
				listOfPackage(file.getAbsolutePath(), pack);
			}
		}
	}

	private static List<String> getPackagesFromIncludeScriptFolder() {
		Set<String> files = new TreeSet<>();
		listOfPackage("Include/scripts/groovy", files);
		Iterator<String> i = files.iterator();
		List<String> packageNames = new ArrayList<>();
		while (i.hasNext()) {
			String name = i.next().replaceFirst("Include.scripts.groovy.", "");
			if (!name.equals("Include.scripts.groovy")) {
				// remove default package
				addPackage(name, packageNames);
			}
		}
		return packageNames;
	}

	public static void addDefaultPackages() {
		CucumberBuiltinKeywords.GLUE = getPackagesFromIncludeScriptFolder();
	}

	private static void addPackage(String name, List<String> packageNames) {
		if (!name.isEmpty()) {
			boolean match = anyMatch(packageNames, name);
			if (!match) {
				packageNames.add(name);
			}
		}
	}

	private static boolean anyMatch(List<String> packageNames, String name) {
		for (String element : packageNames) {
			if (name.indexOf(element + ".") == 0) {
				return true;
			}
		}
		return false;
	}
}

changiairport-isc-automation-77b5c2383e1a 2.zip (6.2 MB)