Testng in katalon

Hello Katalon team,
Can u suggest how to implement testng in katalon? I tried katalium framework in visual studio code, but I did not get it.How can we import the katalon project to visual studio code and and how to write code in katalium framework in visual studio code.

Thanks
kalavathi

Hi kalayasu684

It is not the same concepts

  • Katalium is a framework that provides a blueprint for test automation projects based on Selenium and TestNG.
  • Katalon Studio is an automated testing tool.

If you need to work with TestNG and Selenium, go with Katalium, download the source and example code from the below links, open it with Visual Studio Code.



For simple explanation, Katalium is the blueprint, sample project that based on Selenium and TestNG.

If you need to work with Katalon Studio (testing tool), you can use Katalon Studio and open the example projects under the menu: File > New Sample Project

“how to write code in katalium framework in visual studio code” - as the above information, you can open Katalium project with Visual Studio Code and take a look, How to write it will require you to know about Selenium and TestNG.

Thank you for your answer.
Can’t we use testng annotations in directly in katalon script ?
E.g:Creating package in keyword section.Like
and writing method as
Test annotation here as test or Before Test
WebUI.setText(findTestObject(‘Object Repository/Testlink_login/Page_Login/loginname’),findTestData(‘Testlink’).getValue(1,1))

	println("username= "+findTestData('Testlink').getValue(1,1))

	WebUI.delay(1)

	WebUI.setText(findTestObject('Object Repository/Testlink_login/Page_Login/Password'), findTestData('Testlink').getValue(2,1))

	println("password= "+findTestData('Testlink').getValue(2,1))

	WebUI.delay(1)

	WebUI.takeScreenshot('Screenshots/testlink.png')

	WebUI.click(findTestObject('Object Repository/Testlink_login/Page_Login/login'))

kalayasu684 yes it’s the Test Listeners in Katalon (same as TestNG annotation)

“Error:Can not find symbol @test
while running a downloaded katalium program for github ,it is showing the error

I imported the package: import org.testng.annotations.Test

Use @Test

While I am running your source code in vs code it is getting the same error.
I just created a sample method in LoginTest class and printing the hello world statement .
@Test
public void printhello(){
System.out.println(“printing hello world statement”);
}
Errors are:
LoginTest.java:3: error: cannot find symbol
import com.katalon.kata.sample.Constants;
^
symbol: class Constants
location: package com.katalon.kata.sample
LoginTest.java:4: error: package com.katalon.kata.sample.page does not exist
import com.katalon.kata.sample.page.CuraAppoinmentPage;
^
LoginTest.java:5: error: package com.katalon.kata.sample.page does not exist
import com.katalon.kata.sample.page.CuraHomePage;
^
LoginTest.java:6: error: package com.katalon.kata.sample.page does not exist
import com.katalon.kata.sample.page.CuraLoginPage;
^
LoginTest.java:7: error: package com.katalon.kata.testng does not exist
import com.katalon.kata.testng.TestTemplate;
^
LoginTest.java:8: error: package org.testng does not exist
import org.testng.Assert;
^
LoginTest.java:9: error: package org.testng.annotations does not exist
import org.testng.annotations.Test;
^
LoginTest.java:11: error: cannot find symbol
public class LoginTest extends TestTemplate {
^
symbol: class TestTemplate
LoginTest.java:13: error: cannot find symbol
private CuraHomePage curaHomePage = new CuraHomePage(Constants.baseUrl);
^
symbol: class CuraHomePage
location: class LoginTest
LoginTest.java:15: error: cannot find symbol
private CuraLoginPage curaLoginPage;
^
symbol: class CuraLoginPage
location: class LoginTest
LoginTest.java:17: error: cannot find symbol
private CuraAppoinmentPage curaAppoinmentPage;
^
symbol: class CuraAppoinmentPage
location: class LoginTest
LoginTest.java:28: error: cannot find symbol
@Test
^
symbol: class Test
location: class LoginTest
LoginTest.java:13: error: cannot find symbol
private CuraHomePage curaHomePage = new CuraHomePage(Constants.baseUrl);
^
symbol: class CuraHomePage
location: class LoginTest
LoginTest.java:13: error: cannot find symbol
private CuraHomePage curaHomePage = new CuraHomePage(Constants.baseUrl);
^
symbol: variable Constants
location: class LoginTest
14 errors

Hi guys

I’m excited to let you know Katalon Studio 7.4.0 supports executing TestNG scripts. See this document for how to migrate and new features to facilitate the migration.

Cheers

Jass

Glad to see Katalon Studio 7.4.0 supports executing Test NG scripts ,
Can you please confirm whether you plan to continue TEst NG support in Katalon studio free version for longer time or will there be any change in strategy.

Hi @neha.dua.2

Executing Test NG scripts is confirmed to be a community feature.

Jass