robocorp / rpaframework

Collection of open-source libraries and tools for Robotic Process Automation (RPA), designed to be used with both Robot Framework and Python
https://www.rpaframework.org/
Apache License 2.0
1.17k stars 225 forks source link

RPA.Browser.Selenium does not always close browser instances using Close Browser or Close All Browsers #1186

Closed raivolink closed 6 months ago

raivolink commented 6 months ago

Using the latest Chrome 124.0.6367.79 or Edge 124.0.2478.51 library leaves browser processes running about 75% of runs. Console output:

[2024-04-23T15:21:16.308]: Updating agent status to: C:\ProgramData\robocorp\workers
[2024-04-23T15:21:34.121]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[2024-04-23T15:21:34.122]: @@@  From rcc "v17.12.0" point of view, "actual main robot run" was SUCCESS. @@@
[2024-04-23T15:21:34.123]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[2024-04-23T15:21:48.356]: Warning: "rcc.exe" process 9132 (parent 3656) still has running migrated processes:
[2024-04-23T15:21:48.414]: Warning: + migrated process still running:
[2024-04-23T15:21:48.414]: Warning: | #5728  "msedge.exe" <leaf -> new parent PID: #4460>
[2024-04-23T15:21:48.414]: Warning: | #9444  "msedge.exe" <leaf -> new parent PID: #4460>
[2024-04-23T15:21:48.414]: Warning: | #9448  "msedge.exe" <leaf -> new parent PID: #4460>

Code used:

*** Settings ***
Documentation       Template robot main suite.
Library             RPA.Browser.Selenium

*** Tasks ***
Minimal task
    Open Available Browser   https://robocorp.com    browser_selection=edge 
    Sleep   4 
    Close Browser 

With conda:

# For more details on the format and content:
# https://github.com/robocorp/rcc/blob/master/docs/recipes.md#what-is-in-condayaml
# Tip: Adding a link to the release notes of the packages helps maintenance and security.

channels:
  - conda-forge

dependencies:
  - python=3.10.12                # https://pyreadiness.org/3.10
  - pip=23.2.1                    # https://pip.pypa.io/en/stable/news
  - robocorp-truststore=0.8.0     # https://pypi.org/project/robocorp-truststore/
  - pip:
    - rpaframework==28.5.1        # https://rpaframework.org/releasenotes.html
mikahanninen commented 6 months ago

The problem seems to be related to the Chromium argument --no-sandbox, but why this started to happen in version 124 is still unclear.

As a temporary workaround the library can be modified so that the keyword Open Available Browser can be toggled to set/not set --no-sandbox argument although leaving the argument might have other effects on the automation.