Executing Puppeteer Scripts from Katalon

Hi Team,
Is it possible to give support to run puppeteer scripts from Katalon?

Puppeteer is useful to access and devTools logs and javascript profile information to perform middle-ware(JS based) testing and unit testing. If running puppeteer is possible via katalon then the main motto of being one stop solution for automation will be achieved. :slight_smile:

Regards,
Sheetal

2 Likes

Hi Sheetal

How do the scripts run? In the shell?

You can execute shell scripts in KS using the Runtime:

Runtime.runtime.exec("path/to/your/batchFile.bat")
2 Likes

Thank you Russ so much!

This was really what I wanted. However when I used below code I was able to execute the test case without error but nothing happened.

Runtime.runtime.exec("path/to/your/MybatchFile.bat")So I am looking for solution for this. Sheetal

I’m confused.

Every Java program has access to the Runtime - the following is quoted from the docs (you can see this if you hover the mouse over the word “Runtime” in KS)

Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running.

If “nothing happened”, then what is it you’re trying to execute? Is it a batch file? Something else?

Russ Thomas said:

I’m confused.

Every Java program has access to the Runtime - the following is quoted from the docs (you can see this if you hover the mouse over the word “Runtime” in KS)

Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running.

If “nothing happened”, then what is it you’re trying to execute? Is it a batch file? Something else?

I was trying to execute a batch file.

BTW it worked when I updated the command as below:-
Runtime.getRuntime().exec("cmd.exe /c start test.bat ")

Regards,
Sheetal

1 Like

You’re not the first person to point that out. But it’s crazy, the getRuntime method is the “getter” for the runtime property (field). Java is so crappy sometimes and this is a good example. Runtime.runtime should work – it works perfectly fine here.

Oh well.