You have 2 options, call Selenium driver from Karate or call Karate via the Java API.
- Example of mixing Java code using a Java library into a Karate test (JDBC in this case): dogs.feature. Also refer to how to call Java in the documentation.
- Documentation for how to call Karate from Java: Java API
Personally, I prefer option 1 – which is what you have been doing with Spock.
EDIT: Karate now supports Web Browser automation, so you don’t need Selenium anymore: The world needs an alternative to Selenium – so we built one