2

I have a requirement to open IE11 in private-mode on Winodws10. Tried by following code but it is throwing exception "Unexpected error launching Internet Explorer. Unable to use CreateProcess() API. To use CreateProcess() with Internet Explorer 8 or higher, the value of registry setting in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth must be '0'."

Code: int val = Convert.ToInt32(Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth", "", -1));

            InternetExplorerOptions ops = new InternetExplorerOptions();
            ops.ForceCreateProcessApi = true;
            ops.BrowserCommandLineArguments = "-private";
            IWebDriver driver = new InternetExplorerDriver(url, ops);

There is key in RegEdit and i can read successfully.

2 Answers2

2

Removing ops.ForceCreateProcessApi = true; helps to start the browser, but NOT in private mode. You need the combination of

ops.ForceCreateProcessApi = true;
ops.BrowserCommandLineArguments = "-private";
Robert
  • 5,278
  • 43
  • 65
  • 115
Vethman
  • 71
  • 5
0

I had a problem just like yours. I searched a lot and found no solution until I tried to delete the following line:

ops.ForceCreateProcessApi = true;

And thank God, the problem was solved. I'd love to know if it helped you solve the problem

Tiger-222
  • 6,677
  • 3
  • 47
  • 60
C. Mar
  • 139
  • 1
  • 2
  • 16