Support for "Chrome for Testing" in Katalon Studio

I have developed a Groovy class that quickly enables users to use Chrome for Testing in their test cases in Katalon Studio.

See the Github repository at

Problem to solve

As of the 3rd week February 2024, in Katalon Studio, the “Tools > Update WebDriver > Chrome” failed. See Chrome failed to start: exited normally - #17 by kazurayam for the reason why. Consequently I could not run any test cases in Katalon Studio using Chrome browser.

Solution

I will use “Chrome for Testing” instead of Chrome browser.

“Chrome for Testing” is a flavor of Chrome brower. It was released in July 2023. It has a special characteristic: it does not auto-upgrade itself. I can keep the “Chrome for Testing” and the associated ChromeDriver fixed to a certain older stable version that I choose. With “Chrome for Testing”, I would no longer be disturbed by the frequent upgrades of Chrome and unstable downloads of ChromeDriver. Of course, I can upgrade the version manually when I want to.

Solution explained

Installing Chrome for Testing and ChromeDriver of the version

See the blog for detail. You need “Node” and “npx” installed on your machine (I suppose that all of serious Web developers would have installed Node already).

To install a specific version of “Chrome for Testing”, run the command

$ npx @puppeteer/browsers install chrome@116.0.5793.0

To install the corresponding version of “ChromeDriver”, run the command

$ npx @puppeteer/borwsers install chromedriver@116.0.5793.0

The above demo installs an old version 116.0.5793.0. This is just an example. You can specify any available version in the command line. You can find more detail about the npx @puppeteer/browsers command at the doc page.

How to find the list of available versions? — You can check the most recent available versions at Chrome for Testing availability . As of 25 Feb 2024, this page showed the following image:

availability

The Chrome developers maintains this list up to date.

If you don’t like to be asked to specify a concrete version number, you can do as follows:

$ npx @puppeteer/browsers install chrome@latest
Downloading chrome r123.0.6312.10 - 165 MB [====================] 100% 0.0s
chrome@123.0.6312.10 /Users/kazurayam/chrome/mac-123.0.6312.10/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing

and

$ npx @puppeteer/browsers install chromedriver@latest
Downloading chromedriver r123.0.6312.10 - 9.3 MB [==================] 100% 0.0s
chromedriver@123.0.6312.10 /Users/kazurayam/chromedriver/mac-123.0.6312.10/chromedriver-mac-x64/chromedriver

It is up to you which version to use.

Create a custom Groovy class

I developped 2 groovy codes in the Include/scripts/groovy folder:

The Installation class contains the information in which path you installed the binaries of the “Chrome for Testing” and the ChromeDriver. The code must be customized by you. You are responsible to code the Installation class so that you specify the path information of the binaries you want to use.

The ChromeForTestingDriverFactory class is just reusable, I meant.

Test Case example that uses “Chrome for Testing”

See TC1

Let me copy&paste the source here:

import org.openqa.selenium.WebDriver
import com.kazurayam.ks.driver.chrome4testing.ChromeForTestingDriverFactory
import com.kazurayam.ks.driver.chrome4testing.Installation
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

ChromeForTestingDriverFactory driverFactory =
    new ChromeForTestingDriverFactory(Installation.mac_116_0_5793_0_mac_x64)
WebDriver driver = driverFactory.newChromeForTestingDriver()
DriverFactory.changeWebDriver(driver)

WebUI.navigateToUrl("http://demoaut.katalon.com/")
WebUI.delay(3)
WebUI.closeBrowser()

This test case will run using Chrome for Testing version 116.0.5793.0.

Please note that your Test Case script MUST NOT call WebUI.openBrowser(). The call to driverFactory.newChromeForTestingDriver() will open a window of Chrome for Testing. So no need to duplicate a call to WebUI.openBrowser().

Headless mode

You can open Chrome for Testing in Headless mode. See the code

5 Likes

Hi,
It is such a wonderful sharing about this issue. There might be lots of people who can gain benefits from your post.

According to this issue of Chrome Driver not being able to auto-upgrade, Chrome for Testing is a great alternative. We also have a video of a workaround with Chrome for Testing to help you.

My team also suggest another workaround as the following:

Hope this can help. Thank you!

1 Like

I personally do not need this tips as I will use “Chrome for Testing”; I won’t use Chrome browser with Katalon tests any longer. So I do not need the webdrivermanager in Katalon Studio to function for Chrome.

However, to the Katalon users in general, I think that Katalon should post this information as an official public announcement addressed to every users with appropriate title and sufficient explanation why; what this trick does.

This path seems to be the one on Mac.
Most of your users are on Windows.
So they would need more thoughtful information.

1 Like

Now I understand that Katalon Studio depends on the WebDriverManager of Boni Garcia.

Their list contains two related issues:

We can see the change they made at this diff page

What did they do? They changed the URL string format

from

wdm.chromeDownloadUrlPattern=https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/%s/%s/chromedriver-%s.zip

to

wdm.chromeDownloadUrlPattern=https://storage.googleapis.com/chrome-for-testing-public/%s/%s/chromedriver-%s.zip

This change is easy to understand. Clear enough.

However, there remains a concern. In future, what will happen when the ChromeDriver project changes the download URL format again? Well, as you can easily guess, we will get into a trouble again. We will need Katalon Studio to be upgraded in order to get the updated version of webdrivermanager bundled. This risk will remain in the future.

I think that the webdrivermanager is 99% OK but not a perfect solution for Katalon users.

I think, “Chrome for Testing” could be a safety net that could help us in case.

3 Likes

Sorry, i need information about comparison on Memory usage. Its on 2, Memory usage on the file itself and while its running. Is it still the same or more or less than Chromedriver as usual ?
It might be a solution for me that need efficiency and constant.
Also, if i have some cases running to Chrome using Android, am i must install Chrome for Testing in my Android ?
Thanks.

1 Like

I don’t understand your question. What are you worried about?

Are you worried if the process of “Chrome for Testing” may require far larger memory runtime than the process of ordinary Chrome browser? ------- I don’t know. I have never examined it. I am not interested in it.

I expect no difference.They say “Chrome for Testing” is a flavor of Chrome, which has just a subtle difference: it does not auto-upgrade. So there must be no difference when your test runs with the two types of browsers.

I think because its non-upgradeable Chrome, it should be less require memory runtime.
If its like you said that “Chrome for Testing” is flavor of Chrome, then i would take that the benefit is it does not auto-upgrade and that’s it.
Thanks.

? I don’t think so.

1 Like

Okay then. Thanks for the information, will use it for my project.

I have made several changes to the GitHub repository

  1. renamed the project: ks-chrome-for-testing-keywordks-chrome-for-testing-support

  2. moved the source of the classes out of the Keywords folder into Include/scripts/groovy.

  3. tagged the version 0.2.0

See the issue #7 for the reason of this change.

I editted the original post slightly to mention:

The above demo installs an old version 116.0.5793.0. This is just an example. You can specify any available version in the command line.

It is up to you which version you try.

Yes, any suggestions on the path to replace for Windows

I don’t have a Windows box. Please find the answer yourself.

When you execute the following command

then the “@puppeteer/browsers install” will show you in which path it has installed the binary. Don’t miss the message.

Katalon Studio v9.3.1 has been released today. The version includes the hot fix for the problem of Chrome failed to start: exited normally - #17 by kazurayam. The party is over.

Now I would like to look back something. In the page GitHub kazurayam/ks-chrome-for-testing-support > insights > traffic, you can find the following graph:

Till 2/28 2024, this project has been visited by 39 unique visitors. This is a fact.

I think that the 39 visitors are really proactive Katalon users today. They encountered the aforementioned problem. They wanted to find any solutions available at the time. They went through the posts in the user forum and found this post. They got interested in the idea “¡Shall we use Chrome for Testing in Katalon?” and clicked the link.

Now I would play with this figure 39. Years ago, I learned a term “early adaptors”. See Wikipedia page Technology adoption life cycle to find what this term means. The theory tells me that the number of early adaptors would occupy 13.5% of the population. So I would guess that the number of acting Katalon users today could be something around:

(39 * 100) / 13.5 = 289

Well, this figure looks plausible to me. I am glad to have 289 mates in this forum. Thank you, everyone.

2 Likes

Hi all,

Version 9.3.1 has now been released. Please help test this version fixing the issue of upgrading Webdriver and let others know this fix. Thank you!

3 Likes