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
- 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.
- Sometimes IE automation stops working because of oleacc.dll, which is a system windows DLL file responsible with Active Accessibility support.
The following steps can be used to diagnose and find the root cause of the exception.
- 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.
- This error is only generated when using the “Open Browser” Activity.
- Internet Explorer takes too long to start.
- Internet Explorer starts, but the page it opens to, takes too long to load.
To verify that CPU usage is the issue, try the following steps:
- 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.
- 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.
- Consider using Procmon to monitor the computer while the process is running.
- 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.)
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.
- Logon to the account running the automation.
- Open file explorer and go to %userprofile%/.nuget (%userprofile% is a variable that resolves to the current user’s home directory).
- Right click the “packages” folder and select “properties”.
- Go to the Security tab and select “Edit”.
- Next Select “Add”
- 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”.
- After adding the group, make sure that it has the following permissions:
- Read & execute
- List folder contents
- After making this change, check to see if the error still occurs. If does check the section on 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.
- Sometimes after a Windows Update certain .dll files can become unregistered and cause issues with automations that interact with Internet Explorer.
- 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
- Try resetting Internet Explorer Settings.
- Open “run” and type “inetcpl.cpl” to bring up the IE settings page.
- 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.
- 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.
- 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:
- Open the browser to a different URL and then navigate to the URL with the windows logon prompt.
- Open the browser using “Start Process”. Then attach to the browser and navigate to the problematic URL.