How to run on EDGE browser in private mode

When I run Edge this browser doesn’t start in private mode so to test a login I have to logout first. How I can run this browser and set his Desired capabilities to run in private mode?

I tried this without success:

In case of Edge chromium. follow this link:
https://docs.katalon.com/docs/create-tests/manage-projects/project-settings/desired-capabilities/start-browsers-in-private-mode-in-katalon-studio#edge-chromium

Other option is to set it programmatically:

List edge_list = new ArrayList();
edge_list.add(‘-inprivate’)
Hashtable<String, String> edge_dict = new Hashtable<String, String>();
edge_dict.put(“args”, edge_list);
RunConfiguration.setWebDriverPreferencesProperty(‘ms:edgeChromium’, true)
RunConfiguration.setWebDriverPreferencesProperty(‘ms:edgeOptions’, edge_dict)

I have follow the instuctions from the link

but the session won’t be started

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 404. Message: no such window
(Session info: MicrosoftEdge=129.0.2792.79)

did anyone get a solution to this issue ? we re facing the same challenge and not able to switch to a desired profile using the above solution.

To use Katalon Studio with the InPrivate mode of Edge Chromium, do as follows:

  1. In Katalon Studio, go to Project > Settings > Desired Capabilities > Web UI > Edge Chromium.
  2. Add a new property as follows.

Table 1
Name Type Value
ms:edgeChromium boolean true
ms:edgeOptions Dictionary Click More (…). In the pop-up Dictionary Property Builder dialog, click Add, then input values from Table 2.

Table 2
Name Type Value
args List -inprivate