Visual test is failing on TestOps

Cannot invoke “com.kms.katalon.core.driver.DriverType.getName()” because the return value of “com.kms.katalon.core.webui.driver.DriverFactory.getExecutedBrowser()” is null %

Visual test is fail to get take screen shoot

Here is my Script

WebUI.callTestCase(findTestCase(‘Login/login_steps’), [:], FailureHandling.STOP_ON_FAILURE)

WebUI.takeScreenshotAsCheckpoint(‘TC15_chatbot_01’)

WebUI.closeBrowser()

1 Like

Hi @asiddique
can u share more details about the issue.
you are getting the issue

Cannot invoke “com.kms.katalon.core.driver.DriverType.getName()” because the return value of “com.kms.katalon.core.webui.driver.DriverFactory.getExecutedBrowser()” is null %

but it is not clear

1 Like

Here is my Test and it is running properly in Studio
WebUI.callTestCase(findTestCase(‘Login/login_steps’), [:], FailureHandling.STOP_ON_FAILURE)
WebUI.takeScreenshotAsCheckpoint(‘TC15_chatbot_01’)
WebUI.closeBrowser()

here is the execution logs from TestOps

stdout.log (12.0 KB)
error-stack-trace.txt (3.5 KB)

Please Refer the link

WebUI.takeScreenshotAsCheckpoint() → keyword is used to capture the viewport screen shot

while executing it in local it worked fine but in the test ops the viewport may be not visible that’s why you are getting this issue.

pls try WebUI.takeScreenshot() keyword

and please confirm are you using headless browser for execution?

1 Like

I have been having the exact same issue and had started a thread on this myself - Cannot run visual checkpoint tests in TestOps - Product Forums / Katalon TestOps - Katalon Community

I updated my test as you described and used the headless chrome browser to execute it in TestOps and it does pass now but it doesn’t create the visual checkpoint and isn’t shown as a visual test run.

I followed the steps in several Katalon videos that I had watched on Visual Testing to initially set the test up so I’m a bit confused on how to get this to run as a visual test. It really seems like it should be simple but so far it has been anything but that.

@mark.newell
you have to design the cases in the same way u used to execute in the local
try using the WebUi.TakeScreenshot() methot without any input

while scheduling the test run in katalon testops pls enable visual testing

at the end of the test execution check the visual testing dashboard you will get your images

1 Like

I guess I should elaborate a bit more on this. I can run the visual test from within Katalon Studio and it works fine. It connects with TestOps and compares to a baseline collection and is listed under the Visual testing results in TestOps. There is an issue with that where it only uses the first baseline collection for comparison so it doesn’t seem like you can specify which collection to use but it does work.

The issue I am having is running the test from within TestOps using TestCloud. I tried your suggestion and using the standard screenshot allows the test to pass but it doesn’t run as a visual test. The documentation you linked, as well as all of the videos I have watched all state that you need to use the checkpoint version of screenshot to invoke visual testing.

1 Like

@mark.newell The execution will happen as a normal test execution. and the screenshots will be collected from the execution and saved to visual test in the katalon test ops.

we have the option to choose the screenshots to set the baseline in the katalon testops.

Go to Visual Testing > Visual Baseline Collections. Select the Baseline Collection ID you want to check. The list of baseline images appears. Click on the Edit image icon of the baseline image you want to configure (e.g., the baseline image image10).

1 Like

Okay, I think I have figured out most of this but there are still a couple of issues I see with this process. To be clear though, any time I have successfully run a visual test it has been using the takeScreenshotAsCheckpoint method. If I use the takeScreenshot method the test does run but nothing shows up under Reports>Visual Testing in TestOps.

The issues as I see them are: Visual tests will not run using TestCloud as the environment and when running visual tests from studio you don’t have a way to specify which baseline you want to use for comparison as it always just uses the first one you have.

IMHO, the issue with running from Studio is minor (but annoying) as I don’t see Studio as a tool to execute tests and suites for production level use. It seems to be more for authoring and verifying tests will run.

The real issue is not being able to use the TestCloud environment to run the visual tests. It always fails with the error of “Cannot take screenshot”. I have been able to get the visual tests to run using an Agent as the environment which at least gives you a path towards unattended execution of tests based on a schedule or an external event, but I fear my organization may come up against licensing issues if we have to set up an agent on a dedicated machine on prem.

Anyway, thanks for taking the time to help me out and respond to my messages. I believe I will need to contact Support at this point.

1 Like

One last update here. I have been able to get this to run via TestOps using TestCloud by choosing a specific version of the Katalon Runtime Engine when scheduling the test. Previously I had been choosing the “Latest Version” option but when I changed that to 8.6.8 it worked. Latest Version still fails but I believe Katalon will be releasing an update to fix that soon.
image