Open Internet Explorer in Private Mode with Selenium












0














So I've been trying to open IE in Private using selenium (C#), this is the closest i've come so far:



        InternetExplorerOptions op = new InternetExplorerOptions();
op.PageLoadStrategy = PageLoadStrategy.Normal;
op.IgnoreZoomLevel = true;
op.InitialBrowserUrl = "https://entry.wgrintra.net/schadenwv/servlet/main";
op.ForceCreateProcessApi = true;
op.BrowserCommandLineArguments = "-private";
IWebDriver driver = new InternetExplorerDriver(op);


The problem here is, after 60 seconds of opening the browser (correctly in private) the driver times out (last step doesn't finish).



I've looked around a lot, most is just using Capabilities which are not useful anymore.



(I had to add a value to the registry to be able to forcecreate the process api)










share|improve this question



























    0














    So I've been trying to open IE in Private using selenium (C#), this is the closest i've come so far:



            InternetExplorerOptions op = new InternetExplorerOptions();
    op.PageLoadStrategy = PageLoadStrategy.Normal;
    op.IgnoreZoomLevel = true;
    op.InitialBrowserUrl = "https://entry.wgrintra.net/schadenwv/servlet/main";
    op.ForceCreateProcessApi = true;
    op.BrowserCommandLineArguments = "-private";
    IWebDriver driver = new InternetExplorerDriver(op);


    The problem here is, after 60 seconds of opening the browser (correctly in private) the driver times out (last step doesn't finish).



    I've looked around a lot, most is just using Capabilities which are not useful anymore.



    (I had to add a value to the registry to be able to forcecreate the process api)










    share|improve this question

























      0












      0








      0







      So I've been trying to open IE in Private using selenium (C#), this is the closest i've come so far:



              InternetExplorerOptions op = new InternetExplorerOptions();
      op.PageLoadStrategy = PageLoadStrategy.Normal;
      op.IgnoreZoomLevel = true;
      op.InitialBrowserUrl = "https://entry.wgrintra.net/schadenwv/servlet/main";
      op.ForceCreateProcessApi = true;
      op.BrowserCommandLineArguments = "-private";
      IWebDriver driver = new InternetExplorerDriver(op);


      The problem here is, after 60 seconds of opening the browser (correctly in private) the driver times out (last step doesn't finish).



      I've looked around a lot, most is just using Capabilities which are not useful anymore.



      (I had to add a value to the registry to be able to forcecreate the process api)










      share|improve this question













      So I've been trying to open IE in Private using selenium (C#), this is the closest i've come so far:



              InternetExplorerOptions op = new InternetExplorerOptions();
      op.PageLoadStrategy = PageLoadStrategy.Normal;
      op.IgnoreZoomLevel = true;
      op.InitialBrowserUrl = "https://entry.wgrintra.net/schadenwv/servlet/main";
      op.ForceCreateProcessApi = true;
      op.BrowserCommandLineArguments = "-private";
      IWebDriver driver = new InternetExplorerDriver(op);


      The problem here is, after 60 seconds of opening the browser (correctly in private) the driver times out (last step doesn't finish).



      I've looked around a lot, most is just using Capabilities which are not useful anymore.



      (I had to add a value to the registry to be able to forcecreate the process api)







      c# internet-explorer selenium-webdriver internet-explorer-11 selenium-iedriver






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 at 10:18









      Basil Fuchs

      11




      11
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Try to refer code example below and make a test with it on your side may help to solve your issue.






          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }





          Reference:



          How to Open Internet Explorer Browser in Incognito / Private mode using Selenium / WebDriver ?






          share|improve this answer





















          • The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
            – Basil Fuchs
            Nov 22 at 13:09










          • I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
            – Deepak-MSFT
            Nov 23 at 6:01











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409851%2fopen-internet-explorer-in-private-mode-with-selenium%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Try to refer code example below and make a test with it on your side may help to solve your issue.






          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }





          Reference:



          How to Open Internet Explorer Browser in Incognito / Private mode using Selenium / WebDriver ?






          share|improve this answer





















          • The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
            – Basil Fuchs
            Nov 22 at 13:09










          • I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
            – Deepak-MSFT
            Nov 23 at 6:01
















          0














          Try to refer code example below and make a test with it on your side may help to solve your issue.






          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }





          Reference:



          How to Open Internet Explorer Browser in Incognito / Private mode using Selenium / WebDriver ?






          share|improve this answer





















          • The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
            – Basil Fuchs
            Nov 22 at 13:09










          • I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
            – Deepak-MSFT
            Nov 23 at 6:01














          0












          0








          0






          Try to refer code example below and make a test with it on your side may help to solve your issue.






          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }





          Reference:



          How to Open Internet Explorer Browser in Incognito / Private mode using Selenium / WebDriver ?






          share|improve this answer












          Try to refer code example below and make a test with it on your side may help to solve your issue.






          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }





          Reference:



          How to Open Internet Explorer Browser in Incognito / Private mode using Selenium / WebDriver ?






          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }





          import org.openqa.selenium.WebDriver;
          import org.openqa.selenium.ie.InternetExplorerDriver;
          import org.openqa.selenium.remote.DesiredCapabilities;

          /**
          * Created by Amol Chavan on 9/19/2016.
          */
          public class PrivateBrowsing {

          public static void main(String args){
          createInstance();
          }

          public static WebDriver createInstance(){
          DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
          capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
          capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
          System.setProperty("webdriver.ie.driver","C:\Grid\IEDriverServer.exe");
          WebDriver driver = new InternetExplorerDriver(capabilities);
          driver.get("http://www.google.com");
          return driver;
          }
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 at 2:49









          Deepak-MSFT

          622116




          622116












          • The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
            – Basil Fuchs
            Nov 22 at 13:09










          • I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
            – Deepak-MSFT
            Nov 23 at 6:01


















          • The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
            – Basil Fuchs
            Nov 22 at 13:09










          • I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
            – Deepak-MSFT
            Nov 23 at 6:01
















          The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
          – Basil Fuchs
          Nov 22 at 13:09




          The DesiredCapabilities are deprecated (v3.141.0 SeleniumWebdriver) and there is no Force_Create_Process or IE_Switches. Also the IWebDriver doesn't take any capabilities as input.
          – Basil Fuchs
          Nov 22 at 13:09












          I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
          – Deepak-MSFT
          Nov 23 at 6:01




          I will try to search and try to provide you any other solution or work around to solve the issue. thanks for your understanding.
          – Deepak-MSFT
          Nov 23 at 6:01


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409851%2fopen-internet-explorer-in-private-mode-with-selenium%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          Refactoring coordinates for Minecraft Pi buildings written in Python