Console mode error "unable to resolve class org.openqa.selenium.Keys"


#1

I created sample test which works perfectly fine in Katalon Studio. But when I run same test suite from command line to run Katalon in console mode it gives me following error.

2019-01-10 16:27:17.462 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/Google Test Case FAILED.
Reason:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/home/jawaid/Katalon%20Studio/katalon-sample-project/Casitron/Scripts/Google%20Test%20Case/Script1545396047826.groovy: 15: unable to resolve class org.openqa.selenium.Keys
 @ line 15, column 1.
   import org.openqa.selenium.Keys as Keys
   ^

1 error

	at com.kms.katalon.core.main.ScriptEngine.getScript(ScriptEngine.java:199)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:321)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:312)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:291)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:283)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:222)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
	at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
	at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
	at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
	at TempTestSuite1547119629557.run(TempTestSuite1547119629557.groovy:36)

2019-01-10 16:27:17.482 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/Google Test Case

Command run:
katalon --args -noSplash -runMode=console -projectPath="/pathto/Katalon Studio/katalon-sample-project/Casitron/Casitron.prj" -retry=0 -testSuitePath="Test Suites/Google Test Suite" -executionProfile=default -browserType="Chrome (headless)"

How to fix this issue? I need to integrate Katalon with Jenkins.


#2

the project path is wrong. it has to be a PATH the to .prj file, not containing the project file himself


#3

OK, I changed the path. Still the same error.


#4

and it has to be an valid absolute path i think. what means ‘pathto’ there?


#5

Yes, I gave correct absolute path. I obfuscated it to ‘pathto’ here for confidentiality reasons.


#6

It is to note that project does get opened but when it tries to run the test suite it cannot find the library mentioned.


#7

mhm … you can try to cd first into the project dir and run without using the projectPath argument (but pass the full path to the katalon executable) …

it may be indeed an interesting bug


#8

I can try that but issue is that it has to be run by Jenkins and it keep giving the same error. So I tried from terminal myself and getting the same error.


#9

are you using the jenkins plugin? just use a simple shell script (provided the cd stuff is working)


#10

OK it says Missing required argument(s): projectPath
when run without giving the project path from withing the project folder.


#11

No, I’m not using any Jenkins plugin but running the katalon from shell script in Jenkins.


#12

So, if this is a bug what is expected ETA for a fix. Since, I won’t be able to use Katalon until this bug is fixed and thus have to move to some other test suite or maybe Selenium.


#13

any solution to this error?


#14

hi @all, please make sure you guys installed Open JDK 8 (not Oracle JDK) in your Linux machine