Error Running Edge Browser via Orchestrator: How to Fix It?

Error Running Edge Browser via Orchestrator: How to Fix It?

Issue

During the execution of robots using the Microsoft Edge browser through the orchestrator, a specific issue was identified: the browser did not start correctly, whereas when running locally, the flow executed normally.

The error presented was:

Warning

Warning
Message: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir

Investigation

After a detailed analysis, we found that the issue is a known bug already reported in the official Selenium repository, available at:
https://github.com/SeleniumHQ/selenium/issues/15340

This behavior mainly occurs in execution environments controlled by runners.

Solution

To resolve the issue, it was necessary to add the following startup argument in the Selenium settings for Edge:

Notes

Notes
op.add_argument("--edge-skip-compat-layer-relaunch")

This parameter prevents Edge from attempting to relaunch processes using the compatibility layer, which is the root cause of the problem in this execution context.

Important:
The solution was found through comments on the official Selenium issue and has so far proven effective in working around this bug.

Conclusion

If you are facing the same error when using the Edge browser in orchestrated executions, we recommend adding the --edge-skip-compat-layer-relaunch parameter to the driver configuration. This approach avoids the need to change local settings or execution policies and allows the robots to run normally in the orchestrated environment.