Passing desired capabilities during run-time

I know how to change desired capabilities through settings but I now wish to change the desired capabilities during run-time. Is it possible to do this using RunConfiguration?

So far I have tried

import com.kms.katalon.core.configuration.RunConfiguration
RunConfiguration.setWebDriverPreferencesProperty('args', '[--use-fake-device-for-media-stream]')

**And this
**

import com.kms.katalon.core.configuration.RunConfiguration
RunConfiguration.setWebDriverPreferencesProperty('args', '--use-fake-device-for-media-stream')

Unfortunately the desired capabilities are not being handled correctly.

Any suggestions?
Many thanks

2 Likes

List args = new LinkedList();
args.add("–use-fake-device-for-media-stream");
RunConfiguration.setWebDriverPreferencesProperty(‘args’, args);