Consulta SQL, archivo excel y uso de variables Globales

Hola a todos, quisiera que me ayuden para saber si es posible en Katalon realizar lo siguiente:

1-Tengo datos de pruebas en un Excel, digamos una columna id por ejemplo, este Excel está asociado a un Data file de tipo Excel, que se llama ExcelFile.
2-Necesito consultar un código que se genera automáticamente en la base de datos cuando se ejecuta el caso de prueba para ese id, e ingresarlo en una caja de texto para que mi prueba continué su flujo, este código es dinámico y cambia para cada ejecución.

Ahora lo que quiero saber si puedo realizar, creando un Data File de tipo Mysql (la cual se conecta correctamente a la base), la siguiente consulta:

Select codigo form tabla where id=Valor_id_En_Archivo_Excel

He intentado referenciar ese valor pero no sé cual es la sintaxis correcta para hacer referencia al id que tengo en el archivo Excel.

¿Es posiible realizar esto con Katalon?, bien sea asignando el valor de la columna de excel directamente en la consulta SQL o asignando ese valor primero a una variable global y luego referenciar la variable global en la consulta, de ser posible cual sería la sintaxis o procedimiento para realizarlo.

Si no es posible, ¿que opción tengo en Katalon para este tipo de situaciones?.

Muchas gracias de antemano por su ayuda.

Excuse me. Could you use English?

1 Like

Hello everyone, I would like you to help me to know if it is possible in Katalon to do the following:

1-I have test data in an Excel, let’s say an id column for example, this Excel is associated with an Excel-type Data file, which is called ExcelFile.
2-I need to consult a code that is automatically generated in the database when the test case for that id is executed, and enter it in a text box so that my test continues its flow, this code is dynamic and changes for each execution .

Now what I want to know if I can perform, creating a Data File of type Mysql (which connects correctly to the base), the following query:

Select code form table where id = Value_id_En_File_Excel

I tried to reference that value but I do not know what is the correct syntax to refer to the id that I have in the Excel file.

Is it possible to do this with Katalon ?, either assigning the value of the excel column directly in the SQL query or assigning that value first to a global variable and then referencing the global variable in the query, if possible what the syntax would be or procedure to do it.

If it is not possible, what option do I have in Katalon for this type of situation?

Thank you very much in advance for your help.

1 Like

Hi,


You could create data-file from a query from mySQL.

Hi, thanks for your response, but I think you still do not understand what I need to do, I’m going to try to explain myself better.

I need to make a query (in a database data file in mysql) and in the query where to pass as a parameter a value that I have in a column of a data file in excel.
Note: Both Data files are created in Katalon, the MySQL data file is called DB_File, and the Excel file is called Excel_File.

Example:
In the data file excel the column is called id and the query that I need to perform is

Select token from table WHERE code = id

I want to know what is the correct syntax for Katalon to recognize id as the value that is in the excel file.

Try with
Select token from table WHERE code = @ id

Also with
Select token from table WHERE code = & id

Assigning a global variable the value of the excel and then calling in the query

Select token from table WHERE code=@GlobalVariable.id

And nothing works :(, I think I’m not correctly referencing the value.

I hope you can help me.

Thank you

1 Like

I got you now. Unfortunately, you cannot do it manually from the tool. Let’s me have a look on the api to see if you can do it at run time.

Hello, do you know if this functionality will be available in future updates?
Thank you.