Hi there,
I tried to new feature of Selenium 4 via a sample project: GitHub - katalon-studio-samples/katalon-studio-selenium4: Katalon Studio project with examples of using Selenium 4 features.
But the project shows error when I tried to execute testcase, and I found there is missing in the import part, which is it cannot show the: org.openqa.selenium.support.locators.RelativeLocator.
Here is the error detail:
=============== ROOT CAUSE =====================
For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html
08-05-2024 05:14:01 PM Test Cases/Test Relative Locator
Elapsed time: 0.365s
Test Cases/Test Relative Locator FAILED.
Reason:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/D:/Katalon-selenium-4-demo/Scripts/Test%20Relative%20Locator/Script1646063529056.groovy: 24: unable to resolve class org.openqa.selenium.support.locators.RelativeLocator
@ line 24, column 1.
import org.openqa.selenium.support.locators.RelativeLocator as RelativeLocator
^
file:/D:/Katalon-selenium-4-demo/Scripts/Test%20Relative%20Locator/Script1646063529056.groovy: 25: unable to resolve class org.openqa.selenium.support.locators.RelativeLocator.RelativeBy
@ line 25, column 1.
import org.openqa.selenium.support.locators.RelativeLocator.RelativeBy as RelativeBy
^
file:/D:/Katalon-selenium-4-demo/Scripts/Test%20Relative%20Locator/Script1646063529056.groovy: 26: unable to resolve class org.openqa.selenium.support.locators.RelativeLocator
@ line 26, column 1.
import static org.openqa.selenium.support.locators.RelativeLocator.with
^
3 errors
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:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:137)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:128)
at TempTestCase1722852838024.run(TempTestCase1722852838024.groovy:25)
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)
I just want to ask is there a way to add more option in the import or how to fix that in detail?