Getting NPE in TestOps for DriverFactory.getChromeDriverPath()

I’ve created a script to download a file and place it to a desired location within the Katalon project. I was able to run my script successfully on my local Katalon Studio.

Now, I’ve setup my script to run in the TestOps environment and getting NullPointer exceptions. This is the same code that runs okay locally.

[2024-02-29T08:37:55.756Z] [DEBUG]: 	
Reason:
java.lang.NullPointerException
	at crm.crmUI.setDesiredCapabilitiesAtRuntime(crmUI.groovy:166)

This error points to the DriverFactory.getChromeDriverPath())

	String downloadPath = RunConfiguration.getProjectDir() + "/Externals/Downloads/";
	Map<String, Object> chromePrefs = new HashMap<String, Object>()
	chromePrefs.put("download.default_directory", downloadPath)
	chromePrefs.put("download.prompt_for_download", false)
	System.setProperty("webdriver.chrome.driver", DriverFactory.getChromeDriverPath())

	ChromeOptions options = new ChromeOptions()
	options.setExperimentalOption("prefs", chromePrefs)
	WebDriver driver = new ChromeDriver(options)
	DriverFactory.changeWebDriver(driver)

Any ideas on the errors produced by TestOps?

2 Likes

This will return a valid string only when you selected Chrome to run your tests with.
If you selected other browsers (Firefox, Edge, etc) then this method will return null.

@kazurayam

Sorry for the missing info. I’ve actually configured the test to use Chrome v121 in TestOps when I encountered the NullPointer Exception.

OK. You have fixed your problem now?

@kazurayam

Unfortunately no. I’m still getting the same error. Also I’ve added the run configuration properties in the log for further investigation just to see if I can’t find a lead. I’m still working on fixing the issue.

drivers:[system:[Remote:[remoteWebDriverType:Selenium, isEncrypted:true, remoteMobileDriver:ANDROID_DRIVER, remoteWebDriverUrl:JkYzbGlbK9hUB6xO7Y6HXXdzBZSNYtHjRSdFtsEZ8P1TUebW+TJODLYOBYvvRruK9kZFlDthseGnWrY7HeLsFdxRu5DXmZeM1DAOWat+v+/hTXyUb8eRQmesr4K7ffbdXTMYWTWvW4A=, browserType:REMOTE_WEB_DRIVER]]
1 Like

@katalonx
Are you executing your scripts in Cloud?

@katalonx

If you are a paying Enterprise user, you should open a support request for you.

See Katalon Runtime engine collection performance time issues - #4 by albert.vu

@katalonx

Since 15 Feb this year, many Katalon users experienced failures for Chrome v121. You are not alone. Are you aware of it?

Yesterday, Katalon released Katalon Studio v9.3.1 which includes a hot fix for this problem. Have you applied it to your system? If not, just use v9.3.1.

@bharathi.a

Yes. TestCloud Windows Chrome 121.

1 Like

while executing the scripts via the test cloud. You can’t able to launch Chrome by simply declaring it manually

  1. launch the Chrome using WEbUi.Open browser()
  2. get the Chromediver path
  3. add the prefered chrome options you need
  4. using changewebdriver execute your test scripts

From Katalon support: Regarding the error message, our developer confirms that it’s a limitation from TestCloud’s vendor is currently not able to use the DriverFactory class.

Related to this,

Katalon publishes the API Javadoc at

https://api-docs.katalon.com/

They publishes v9.3.1. In the doc, today I can see the list of classes in the com.kms.katalon.core.webui.driver package.

https://api-docs.katalon.com/com/kms/katalon/core/webui/driver/package-summary.html

To my surprise, the DriverFactory class is missing there.

I guess, Katalon made some mistake in the buid processing so that the DriverFactory class is not properly exposed to the external world: for the Javadoc, and for the jars provided to the “TestCloud’s vendor”.

@vu.tran
@Elly_Tran

2 Likes

Hi,

Thank you for your contribution. We will let our team know and investigate more.