How to include database queries in test script? database data files will not work as i am verifying access end date of employee which varies for each login. In selenium we could easily use query which run and provide result during test execution but how to add query in Katalon which needs to be run in each execution.
Take a look at this, this might help you.
Hello,
for updating GET requests, use the same approach as described here
In this case, you may use foreach loop to send requests for all DB rows. Pseudocode:
List<GroovyRowResult> res = sql.getSelectResults('SELECT TOP 10 PERSONAL_ID, PHONE2 FROM CLIENTS WHERE PERSONAL_ID IS NOT NULL AND PHONE2 IS NOT NULL')
for(Map oneRow in res) {
String personalId = oneRow.get("PERSONAL_ID")
String phone = oneRow.get("PHONE2")
// use variables in the GET request here
}
Hello,
of course it is possible. First, you have to set up a database connection, run a query, get count(*) and compare the result. See my sample code:
public class SQLHandler {
String dbConnString = "jdbc:sqlserver://my.sqlserver.com:1433;databaseName=dummy"
String dbUsername = "admin"
String dbPassword = "passwd"
String dbDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
Sql sql = Sql.newInstance(dbConnString,dbUsername,dbPassword,dbDriver)
public List getSelectResults(String q…
1 Like