moustik
September 5, 2023, 2:56pm
1
Hi Kataloon Expert,
I use Gradle to manage my dependencies.
When i click the Run Button in Katalon I have this error message :
NB : the execution works on Windows Terminal when i enter this command line :
And my goal is to make it works on Katalon IDE.
Can someone tell me what to do please?
1 Like
No. I think that you would fail to manage external dependencies for your test scripts in Katalon Studio using Gradle. I wouldn’t say it is impossible, but I know it is hard to achieve. I am saying this based on my previous experience at a project of mine: inspectus4katalon-gradle-plugin .
Katalon Studio is not capable to allow your test scripts to run on top of the classpath constructed by Gradle. Rather, Katalon Studio requires you to follow its own way of constructing the classpath — that is, you have to place the external jar files of your choice in the <projectDir>/Drivers
folder. You are supposed to copy jar files manually into the Drivers
folder. Also, you have to be very careful about the version conflicts. Katalon Studio bundles many external jar files. For example Katalon bundles very old version of google guava on which Google BigQuery library depends. Have a look at the .classpath
file in your project where you can find all the bundled jars. Katalon Studio primarily picks up the bundled old versions. It ignores any newer vesions in the Drivers
folder. If you introduce any jar file of new version which conflict with the bundled old jars, then at runtime you would encounter various errors due to version conflicts.
On the other hand Gradle can construct a classpath for applications while automatically resolving conflicts of jar versions (principally prefer the newer versions). Gradle can save you out of the dependency hell. Katalon Studio just leaves you struggling there.
Gradle downloads external jars into ~/.m2
folder but Gradle does not automatically copy jar files into the Drivers
for Katalon Studio. In the cache, you would be able to find a jar file which contains com.google.cloud.bigquery.BigQuery
class. You can manually copy the jar file from the cache to the Drivers
folder.
@moustik
You seem to be skilled enough for Java/Groovy programming on top of Gradle. You want to use Google BigQuery, which has a large dependency tree . You would desparately need the Gradle’s dependency management capability, which is not applicable to Katalon Studio. Therefore, I would rather recommend you to stop using Katalon Studio . You should be able to develop WebDriver-native tests on Gradle without Katalon. Such tests would be able to utilize Google BigQuery fully. WebDriver-native tests would be easier than Katalon-dependent codes for you because you can entirely rely on Gradle for external dependency management.
1 Like
moustik
September 6, 2023, 2:03pm
3
Thank @kazurayam i love you men ! Your answer are the best for me !
“you have to be very careful about the version conflicts” → Yes It is.
With just a simple query with bigquery, I have 101 jars that Gradle downloaded.
And when i copy/paste all this jars in Drivers and i Run it, I have this errors (may be conflict version) :
Error executing BigQuery query: java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;
and there, I can’t find any solutions…
1 Like
That is just the prologue of an endless series of errors.
Stop using Katalon Studio. That’s the solution.
Katalon Studio lacks the real dependency management capability. It is not designed for developing applications that requires any external libraries (such as Google BigQuery) with a large dependency tree that conflicts with Katalon-built-in jars.
You should develop your WebDriver-native tests with Google BigQuery on Gradle in any IDE of your choice, but not in Katalon Studio.
2 Likes
moustik
September 8, 2023, 8:35am
5
Thanks u Kataloon Brother
And is there anyone who can tell me if there is software that can group together all 101 jars?
I would like to do one last test before leaving the Katalon adventure for this project.
1 Like
You have a Gradle project which successfully drive the com.google.cloud.bigquery.BigQuery class, right? Somehow you have got to know that the project depends on 101 jar files. You want to copy the 101 jar files into the katalon’s Drivers
folder. But it is too tiring, boring, error-prone to pick up all jar files and to copy them one by one manually. So you are asking us how to write a script that makes the list of 101 absolute file paths. Am I right?
Gradle only knows the answer.
In the build.gradle
file, add the following lines:
task showMeCache doLast() {
configurations.compileClasspath.each { println it }
}
This fragment defines a custom Gradle task named showMeCache
. In the command line, you want to run the task as follows:
$ gradle showMeCache
Then the showMeCach
task will emit something like this:
> Task :showMeCache
/Users/kazurayam/.m2/repository/com/kazurayam/inspectus/0.9.5/inspectus-0.9.5.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-java/4.6.0/483554b0965a6bf9ab7c1200681b2868dc775ba6/selenium-java-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-chrome-driver/4.6.0/204b9705edc51a497b155d70e1ee9d530616e9ab/selenium-chrome-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-devtools-v105/4.6.0/dd32240419824b93581641ebf6f3bfa0237a7a0b/selenium-devtools-v105-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-devtools-v106/4.6.0/a5696539baa8507326b1aba8717a577eab1c2588/selenium-devtools-v106-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-devtools-v107/4.6.0/63a9baeebfca9e1678de4acec391ffcfb91ff630/selenium-devtools-v107-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-firefox-driver/4.6.0/903a14bc80efcd06aebf77a8909de1d9df1e49fc/selenium-firefox-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-devtools-v85/4.6.0/a675910ee50b61877ea9947054a1031f57cb9b8a/selenium-devtools-v85-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-edge-driver/4.6.0/d43704e2ed4c9763e6b2b22b0c4c297e6adcf86d/selenium-edge-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-ie-driver/4.6.0/e91b9424d0172b847c17037c774237ef2248c677/selenium-ie-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-safari-driver/4.6.0/8af62a11fc558cc457169a5e0264ed93dbb42d45/selenium-safari-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-support/4.6.0/e85a67305cebb19c67966004c929c0a756da10c6/selenium-support-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-chromium-driver/4.6.0/ead84b71299ce5155372eec55e415c479adc6db7/selenium-chromium-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-remote-driver/4.6.0/ff5c6d9c5cb387ad728b54569613dd265ebe47ba/selenium-remote-driver-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.asynchttpclient/async-http-client/2.12.3/6dfc91814cc8b3bc3327246d0e5df36911b9a623/async-http-client-2.12.3.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.asynchttpclient/async-http-client-netty-utils/2.12.3/ad99d8622931ed31367d0fef7fa17eb62e033fb3/async-http-client-netty-utils-2.12.3.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.30/b5a4b6d16ab13e34a88fae84c35cd5d68cac922c/slf4j-api-1.7.30.jar
/Users/kazurayam/.m2/repository/com/kazurayam/materialstore/0.16.5/materialstore-0.16.5.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-http/4.6.0/c1c9cb6337752f0f45d9ca763eac8964fca0e3cd/selenium-http-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-json/4.6.0/2baac9bd97d7a25ba8bc18fec491dbf9fc49dc4a/selenium-json-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-manager/4.6.0/d18ae15e5b0dc1e5aa7df6d276fec0fd7251a756/selenium-manager-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.seleniumhq.selenium/selenium-api/4.6.0/dc66aab833dd90b7467c6400cc8de23386f364cf/selenium-api-4.6.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.2/3edcfe49d2c6053a70a2a47e4e1c2f94998a49cf/gson-2.8.2.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.github.java-diff-utils/java-diff-utils/4.11/e674e7408acefe082e7421d37f5d866e49dc468f/java-diff-utils-4.11.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.auto.service/auto-service/1.0.1/c9779f7372192a96c957a3df1faeeabd07881085/auto-service-1.0.1.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.auto.service/auto-service-annotations/1.0.1/ac86dacc0eb9285ea9d42eee6aad8629ca3a7432/auto-service-annotations-1.0.1.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.auto/auto-common/1.2/ca270191fd7d2a7297da7c8f29184206df10c67d/auto-common-1.2.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/31.1-jre/60458f877d055d0c9114d9e1a2efb737b4bc282c/guava-31.1-jre.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.82/a7c5fef184d238065de38f81bbc6ee50cca2e21/jcommander-1.82.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler-proxy/4.1.60.Final/2352f12826400e5db64b36fd951508ce9a61c196/netty-handler-proxy-4.1.60.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.1.84.Final/78628e78087d3da6c3d2b22aa67798d3f3adcd68/netty-codec-http-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-epoll/4.1.84.Final/3b4ae5fcbec8d667d8688c17d625be245b2f657e/netty-transport-native-epoll-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-epoll/4.1.84.Final/5757eea869b675e6acf135dada2c2623700a2596/netty-transport-native-epoll-4.1.84.Final-linux-x86_64.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-classes-epoll/4.1.84.Final/ef84f856ed42c6ab8b5c89a7cf90b8ba4574c198/netty-transport-classes-epoll-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-kqueue/4.1.84.Final/68a1b38fbd166d670437f97f910cb549d7e5c7a4/netty-transport-native-kqueue-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-kqueue/4.1.84.Final/8950de7476fb190b0493ab4fda2b37d1c0bd19af/netty-transport-native-kqueue-4.1.84.Final-osx-x86_64.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-classes-kqueue/4.1.84.Final/8b0f24ef191a0472d3ed72c1923683b4e07000f9/netty-transport-classes-kqueue-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.typesafe.netty/netty-reactive-streams/2.0.4/f77c8eaa7d5e2f2160b6d21ba385cf726f164b2/netty-reactive-streams-2.0.4.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.1.84.Final/69cd93e2c321f04fc0a18eb5af519565373d0873/netty-handler-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-unix-common/4.1.84.Final/e51601ddb88ee646a97ff04db38d45c22c29aee8/netty-transport-native-unix-common-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-socks/4.1.60.Final/6f4573281df659265bd709fd10471c3e00ef6c70/netty-codec-socks-4.1.60.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.1.84.Final/4f60f56c4cd17db114f01dc64aa465a2905240f5/netty-codec-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.1.84.Final/acd9947d0a951b1f7021c7adc393df936b1ecbf0/netty-transport-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.1.84.Final/a6b8cf57cfffc28d8e33f8175788a99401f576d9/netty-buffer-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-resolver/4.1.84.Final/b6f808e331cf843d2a7ff62042cf9b5343e2ff25/netty-resolver-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.1.84.Final/90c84ec7f1108ae164810cf46694a5ec7ce738fc/netty-common-4.1.84.Final.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-exporter-logging/1.19.0/43b1d975e120466eb45652c25dbd7bf5ad677c06/opentelemetry-exporter-logging-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure/1.19.0-alpha/be91893255e90e0214dea41e830ad94d063f3e3a/opentelemetry-sdk-extension-autoconfigure-1.19.0-alpha.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi/1.19.0/750c827b83ae244390ed5599e361a94bf6a8c20a/opentelemetry-sdk-extension-autoconfigure-spi-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk/1.19.0/a21c5b15550287f9d4782b18d82d944504fbe47e/opentelemetry-sdk-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk-trace/1.19.0/3683370ef425efe9cf794f3d57016f687e7ca5df/opentelemetry-sdk-trace-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk-metrics/1.19.0/7a588f89f003fdf19e2a50bfd977c2a9075d4c98/opentelemetry-sdk-metrics-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk-logs/1.19.0-alpha/95e901fa9a6beb67ff83e353843556f490fec719/opentelemetry-sdk-logs-1.19.0-alpha.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-sdk-common/1.19.0/72b3793dd29065e43a7b426f9b34ed6d23483f52/opentelemetry-sdk-common-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-semconv/1.19.0-alpha/82f96bb99718c204a7775de298aabde2f6bffd2e/opentelemetry-semconv-1.19.0-alpha.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-api-logs/1.19.0-alpha/ed7f8c511cca3fe6e50d77f9cf740dd02483faef/opentelemetry-api-logs-1.19.0-alpha.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-api/1.19.0/95233814c9eb16486525e8e895a6ed326f3cb5f4/opentelemetry-api-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.opentelemetry/opentelemetry-context/1.19.0/ae42d505048d264b08a3ad1bfa2aff532f244f54/opentelemetry-context-1.19.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/io.ous/jtoml/2.0.0/2085505b2b173e14b2a7702edd703ce185fd6206/jtoml-2.0.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.12.18/875a9c3f29d2f6f499dfd60d76e97a343f9b1233/byte-buddy-1.12.18.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-exec/1.3/8dfb9facd0830a27b1b5f29f84593f0aeee7773b/commons-exec-1.3.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.guava/failureaccess/1.0.1/1dcf1de382a0bf95a3d8b0849546c88bac1292c9/failureaccess-1.0.1.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/b421526c5f297295adef1c886e5246c39d4ac629/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/3.12.0/d5692f0526415fcc6de94bb5bfbd3afd9dd3b3e5/checker-qual-3.12.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.11.0/c5a0ace696d3f8b1c1d8cc036d8c03cc0cbe6b69/error_prone_annotations-2.11.0.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.3/ba035118bc8bac37d7eff77700720999acd9986d/j2objc-annotations-1.3.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.3/d9fb7a7926ffa635b3dcaa5049fb2bfa25b3e7d0/reactive-streams-1.0.3.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/com.sun.activation/jakarta.activation/1.2.2/74548703f9851017ce2f556066659438019e7eb5/jakarta.activation-1.2.2.jar
/Users/kazurayam/github/dotfiles/.gradle/caches/modules-2/files-2.1/dev.failsafe/failsafe/3.3.0/c0bc601c7116fa42a410763e7cfef32b596b94bc/failsafe-3.3.0.jar
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
This is the exact list of paths of the jars which my Gradle project actually depends upon. Only Gradle can make it.
@moustik ,
Your project may have a far longer list.
You can modify the showMeCache
task so that it copies 101 jar files from the Gradle’s cache into the Drivers
folder in your Katalon project. Perhaps you should change the task name to something more appropriate.
Once you finished copying the jars in the Drivers folder, you would run your Katalon Test Case which wants to drive Google BigQuery. Then you will encounter an endless sequence of errors caused by the conflicts of the jar versions. Enjoy!
1 Like
moustik
September 12, 2023, 10:14am
8
Yes exactly. only errors. I stopped Gradle and Katalon for this project.
It’s really a shame for Katalon.
I will study the WebDriver track with VisualStudio
You want to study the Selenium 4 track with Gradle, right?
There are good tutorials, like
The book provides a web site for practicing Selenium programming.
This practice site is worth for every WebUI testers having look at . This helps learners a lot.
It’s a shame that Katalon does not provide such Practice site to learn their products.
1 Like
dineshh
September 13, 2023, 6:10am
10
Thanks for the info with tutorials!