Open Browser Activity Error "Open browser: Can Not Communicate With Internet Explorer Browser"

How to troubleshoot when using Open Browser activity, error is generated: "Open browser: Can not communicate with Internet Explorer browser." ?

Error Description: When using an “Open Browser” activity the error “Cannot communicate with Internet Explorer browser.” is generated.



Root Cause: This error can occur for a few reasons, such as
  1. If CPU is high, then IE can fail. This can happen during logon or when opening too many internet explorer instances. The ETL logs can be used to verify this problem. See screen shots below.
  2. Sometimes IE automation stops working because of oleacc.dll, which is a system windows DLL file responsible with Active Accessibility support.
2.jfif
3.jfif
The following steps can be used to diagnose and find the root cause of the exception.


Diagnosing Steps:
  • If this issue is intermittent then go to the Troubleshooting Intermittent Browser Communication Issues section below
  • If the error was encountered upgrading to 18.3 or above, please go to the Fixing Application Packages Permission section below
  • If using UiAutomation package 19.4.+ and the the first page that IE opens is a page requiring a user to enter their username and password in a Windows security prompt, go to the Handling Login Screen section.
  • Check the configuration settings of Internet Explorer
    • Open “run” and type “inetcpl.cpl” to bring up the IE settings page
    • Go to the “Advanced” tab.
    • Check to see if either of the Enhanced Protected Mode settings are enabled.
  • If either of these settings are enabled, then go to the Fixing Application Packages Permission section.
  • If none of the above solutions have helped, go to the section on System Misconfiguration.


Intermittent Browser Connection Issues
These are the following conditions under which the “Cannot Communicate with browser” issue can occur intermittently.
  1. This error is only generated when using the “Open Browser” Activity.
  2. Internet Explorer takes too long to start.
  3. Internet Explorer starts, but the page it opens to, takes too long to load.
The typical scenario where this situation will occur is when the CPU load is too high as Internet Explorer is known for having poor performance under such conditions. In this situation, certain timeouts in the Robot activities will be reached and generate the “Cannot Communicate with browser exception”. (these timeouts cannot be controlled by the user).

To verify that CPU usage is the issue, try the following steps:
  1. Check the CPU usage at logon time. At logon time, the CPU usage can be especially high due to logon scripts or programs.
    • Logon to the machine and then logout (do not disconnect!). This step is to ensure that the computer does all its logon operations.
    • Log back into the machine and immediately open task manager.
    • If CPU is high, then consult with your system admin to determine what is causing the spike in CPU usage.
    • You may have to immediately try starting the Robot from the Robot tray after logging in.
    • As a workaround, try adding a delay to the automation so that it waits to run until after CPU usage has decreased. Also try a retry mechanism.
  2. Watch the automation run
    • Logon to the machine.
    • Open Task Manager.
    • Start the automation once CPU usage is low.
    • See if the CPU spikes when the automation is running.
    • If CPU usage is high while the automation is running, try to minimize how many browser tabs get open at one time and try to reduce the number of applications running in the background.
  3. Consider using Procmon to monitor the computer while the process is running.
  4. Generate an ETL file and open a support request.
    • Follow the instructions for generating diagnostic logs present at Enabling Robot Diagnostic Logs
    • Open a support request and include the generated ETL file. (A special application is required to read the file.)
If any of these tests show that CPU usage is high, see below for best practices and work arounds. Also consider working with local IT team to resolve the issue.


Fixing Application Packages Permission
When running Internet Explorer in Enhanced Protected Mode, any application or its components have to a special permission in order to interact with Internet Explorer.
Prior to 18.3 UiPath packages had this permission by default, however after 18.3 some packages were moved to %userprofile%/.nuget and no longer have the special permission.
  1. Logon to the account running the automation.
  2. Open file explorer and go to %userprofile%/.nuget (%userprofile% is a variable that resolves to the current user’s home directory).
  1. Right click the “packages” folder and select “properties”.
  2. Go to the Security tab and select “Edit”.
  1. Next Select “Add”
  1. In the “Select Users or Groups” dialog box, type in the object as “All Application Packages”. After typing it in, click “Check Names” and then “OK”.
  1. After adding the group, make sure that it has the following permissions:
    • Read & execute
    • List folder contents
    • Read
  1. After making this change, check to see if the error still occurs. If does check the section on System Misconfiguration.


System Misconfiguration

These problems can be very difficult to diagnose because they do not always generate system errors that can be used to find the misconfiguration. But there are some configurations settings we can reset to solve these issues.
  1. Sometimes after a Windows Update certain .dll files can become unregistered and cause issues with automations that interact with Internet Explorer.
The easiest way to verify these files are registered are just to re-register them by using regsvr32. More info can also be found at Identifying UI Elements After Windows Updates
  • These series of commands will make sure the correct dll files are registered and are perfectly safe to run.
  • Open an elevated Command Prompt.
  • Run the following series of commands:
    • regsvr32 C:\Windows\System32\oleacc.dll
    • regsvr32 C:\Windows\System32\oleaut32.dll
    • regsvr32 C:\Windows\SysWOW64\oleacc.dll
    • regsvr32 C:\Windows\SysWOW64\oleaut32.dll
  1. Try resetting Internet Explorer Settings.
    • Open “run” and type “inetcpl.cpl” to bring up the IE settings page.

  1. Go to the “Advanced” tab > Select the “Reset” button.
  • In the Dialog screen that pops up, select “Delete personal settings”.
  • Click Close when the resetting process finished.
  • Un-check Enable third-party browser extensions option in the Settings box.
  • Click Apply, click OK.
  1. As a last resort, you can try re-installing Internet Explorer.
    • Open a “Run” window and type “OptionalFeatures.exe” to bring up the Windows Features application.
    • Uncheck Internet Explorer and select “OK”
  • Restart computer
  • Repeat the process, but this time re-enable Internet Explorer.
  1. If at this point the issue persists, open a support request with UiPath.

Handling Login Screen

If using UiAutomation package 19.4.2+ it is possible that an error will be encountered when the Robot executes an “Open Browser” activity with IE that opens to a page requiring a user to interact with a windows logon screen. This is a bug and the fix is scheduled for 20.6 as of writing this article.

The following workaround can be used to deal with this issue:

  1. Open the browser to a different URL and then navigate to the URL with the windows logon prompt.
  2. Open the browser using “Start Process”. Then attach to the browser and navigate to the problematic URL.
1 Like