MySql data fails to load when executing from TestOps but works locally

Did not find any related issue to MySql or TestOps data source.
  • Katalon Studio Version: 7.6.8 locally because newer versions have defects related to debugging code where I cannot use the debugger and step through the code. There are other issues to so I had to downgrade to a stable version.

I did attempt to execute on 7.8.1 on the TestOps “Test Environment” as well as 7.6.8.

  • OS Version: Windows 10

  • Browser Version: Chrome 86 but all tests are API.

Steps to Reproduce:

  1. Execute API test locally and test suite completes as expected but the error below occurs when executing from TestOps. The test suite fails when loading data from Katalon’s “Data Files”. Data “file” is a MySQL connection. The same MySql connection is used for GUI testing but this is my first attempt at using Katalon’s data binding. Again, the tests execute locally but not from TestOps. I’ve attached a screenshot of the MySql connection using Katalon’s “Data Files”

  2. Failure from TestOps is below.
    “ExecutionException: java.lang.IllegalArgumentException: Data source of test data: Data Files/API_QUERY_GRAMMAR is not available”

Expected behavior: Data is sourced into the test runs when executing from TestOps

Screenshots: No screenshots but debug log is attached.

debug.log (19.0 KB)

At first look, seems to be a connectivity issue.
How is your Test Environment set in TestOps, it is an local environment or an AWS / Kubernets one?

To debug it, you may have to log into into the executor (ssh if it is linux or rdp if it is a windows machine) and make sure the IP of the machine hosting the DB it is reachable (and port 3306 it is not blocked by a certain firewall)

Hi @anon46315158,

Thanks for reaching out. The execution is local and not on AWS. The same MySql database is accessible for other testing using groovy to connect. However, in this case, I’m using the connection panel provided by Katalon to connect to the database. That connection is verified from Katalon but fails to connect when executing from TestOps.

I don’t know how Katalon is connecting to the database at run-time when using Katalonc.exe so there may be something happening there. I also just experienced “cannot fetch data, invalid driver” when Katalon GUI started. I clicked “fetch data” and was able to retrieve the data. Could it be a timing error when executing from TestOps?

Let me know if you or anyone else needs additions logs or screenshots.

what exactly means this ‘local’?
i assume you set a certain executor in testops environment, so you have to login on that machine and check the connectivity with the sql db from there.

i am not very experienced with testops but from my understanding testops it is just triggering the execution of katalon on a certain remote agent (not on the same server where testops is hosted).

Local means within my network and not in the cloud (AWS/Kubernetes, etc.).

Yes, the agent is installed on a VM and can execute the test using Katalon. FYI - TestOps uses the command line version of Katalon which is katalonc.exe.

I hope someone with TestOps experience from the Katalon dev team will see this post and respond.
Thanks for you help.

Hi @Loan_Tran, I’m not familiar with how bugs are reported but I could use some assistance with the issue in this post. Is there anything else I can do to have someone look into this issue besides posting it as a bug in the group?

Thanks,
Jim

so, again. have you checked the connectivity to the database from the VM where the agent is running ?
up to now you only said that is working fine from GUI (which i suppose is your workstation).

Although you also mentioned:

which may indicate you have some issues with your network, therefore the flakiness.

This post will be long as I try to explain what I see from my side and in the log files.

Database Access
The MySql database is accessible because the same database is used for all other Katalon tests. The connection string is built in Groovy and those tests execute without issue.The database is accessible because I am able to execute from Katalon GUI. I can also execute against the MySql database using Katalon’s “Data File” from Katalon GUI. I have also verified execution from the VM that TestOps uses. The bug is that I cannot execute using TestOps CI.

Theory
The problem looks to be related to Katalon’s “Data File” connection which is built and managed by Katalon. See screenshot. Or it may be related to KatalonC.exe and how that database connection is instantiated at run-time.

My First Clue
The error on startup of Katalon GUI where database is not accessible could be a compile time error or a timing error. This error is displayed immediately after Katalon starts and restores my open files.

I acknowledge the error and click “fetch data” and the db connection works and the data is retrieved. So something is going on during startup that I think is also affecting the TestOps execution.

My Second Clue
I’ve attached a new debug.log of the today’s TestOps execution that has this error.
“ExecutionException: java.lang.IllegalArgumentException: Data source of test data: Data Files/API_QUERY_GRAMMAR is not available.”

Conclusion
The “Data File” error at start up where database driver is not available in Katalon GUI with the error in the debug.log is why I think Katalon’s “data file” is the culprit. There is just something about how “Data File” doesn’t work at startup makes me think that is where the error is.

I’m happy to answer any other questions or try any suggestions you have Bionel or from anyone else.

debug (2).log (19.0 KB)

Update:
I thought about trying different drivers located in Katalon and in the project. The driver I had listed was not actually installed on the system so that made me think that the driver I entered had no effect on the connection.

Solution
I removed the driver from the panel and tested connection and it worked - without a driver.
I then executed from TestOps and the connection worked.
image

I guess Katalon is using an internal driver for the MySql connection and when I entered a driver by name, TestOps couldn’t find it.

Katalon GUI didn’t find it at start-up and that is why the inital connetion failed. Apparently, Katalon has a error handling built in to locate a suitable alternate driver and that is why Katalon GUI db connection worked on the second try of “Fetch data”.

While it is misleading to ask for a driver, I’m relieved that the solution is to leave the driver blank and the everything works in Katalon GUI and TestOps as expected.

1 Like

Hi @jim.sears,

The JDBC driver is the JBDC driver class name that has a supported library connection (JDBC). If your connection type is one of MySQL, MS SQL, Oracle, PostgreSQL, you don’t need to enter the JDBC driver class name.
For further details, please go through our document https://docs.katalon.com/katalon-studio/docs/database-settings.html

that was my second thought.
the JDBC driver field it is needed when you connect to a db other then the ones supported by default in katalon (e.g sqlite) > you need to have the required .jar added in your project in External libs in such case.
glad you figured out what was wrong.
cheers!

Hi @duyluong,

I thought I reviewed that page but I must have missed that version. I haven’t got a handle on where the latest documentation resides… that is probably on me.

As a suggestion, I wish there was a “question mark / link” on each page of KS that would redirect a user to the latest documentation for that topic. The db page in KS could have link that would connect me from KS directly to the page link you sent me. What do you think? Would that help newbies like me find the documentation they need while reducing the need for developers like you to send me links? :slight_smile: