title: Selenium Chrome Driver : user data directory is already in use
body: <p>For this same error there are many questions in Stackoverflow. But none of them solved my problem. So I have to post this again. </p>
  
  <p>My Code:</p>
  
  <pre><code>            ChromeOptions options = new ChromeOptions();
              options.AddArguments("--disable-gpu");
              options.AddArguments("--disable-extensions");
              options.AddArgument(@"user-data-dir=C:\Users\myname\AppData\Roaming\Chrome\Profile 6");
              options.AddArgument("--profile-directory=Profile 6");
              IWebDriver driver = new ChromeDriver(options);
              driver.Navigate().GoToUrl("https://google.com");
  </code></pre>
  
  <p>Initially I was getting an error <code>" Unable to move cache folder, access denied."</code> 
  then I have added the line <code>options.AddArguments("--disable-gpu");</code> and the error is gone.</p>
  
  <p>Now my Code is opening the browser with profile : "Profile 6". But after that its throwing the error
  Error in the line : <code>IWebDriver driver = new ChromeDriver(options);</code> </p>
  
  <p><em>"Exception thrown: 'OpenQA.Selenium.WebDriverException' in WebDriver.dll
  An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll
  invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
  "</em></p>
  
  <p>I have already read almost all topics related to this error. Few of them are :</p>
  
  <p><a href="https://stackoverflow.com/questions/50635087/how-to-open-a-chrome-profile-through-user-data-dir-argument-of-selenium">How to open a Chrome Profile through --user-data-dir argument of Selenium</a></p>
  
  <p><a href="https://stackoverflow.com/questions/59987080/invalidargumentexception-message-invalid-argument-user-data-directory-is-alre">InvalidArgumentException: Message: invalid argument: user data directory is already in use error using --user-data-dir to start Chrome using Selenium</a></p>
  
  <p><a href="https://stackoverflow.com/questions/56585508/how-to-initiate-a-new-chrome-session-when-the-default-session-is-already-running">How to initiate a new Chrome session when the default session is already running using ChromeDriver and Chrome through Selenium and Python</a></p>
  
  <p>I am stuck in this problem for more than a week now. Please help.</p>
  
  <p><strong>EDIT:</strong>
  To confirm that I am not using the already opened default user profile, I checked <code>Cheome://version</code> to confirm the user data directory path. Its different than the default.</p>
  
  <p>Also I tried to to run the code after closing all the open chrome instances. This Time I have not received the error. The browser opened by the webdriver. But after that nothing happened. The code got time out error after 60 seconds in the line :  <code>IWebDriver driver = new ChromeDriver(options);</code></p>