title: How to keep browser open/reuse with Selenium?
body: <p>I've looked extensively through Google and Stackoverflow, but i cant find a good way to implement keeping the browser open after a run and reuse it for the next run. I have it login, get text, but it closes after. I want to keep it open so I dont have relaunch the browser, login again and take more time than necessary. Simply want to use that same webpage, refresh/update the page, and get the new text(its dhtml). I have it to run every 10 seconds or so. Here what i have so far.</p>
  
  <pre><code>using (var driver = new ChromeDriver(""))
              {
  
              driver.Navigate().GoToUrl(@"");
  
              // Get User Name field, Password field and Login Button
              var userNameField = driver.FindElementByName("j_username");
              var userPasswordField = driver.FindElementByName("j_password");
              var loginButton = driver.FindElementByName("Submit");
  
              // Type user name and password
              userNameField.SendKeys("");
              userPasswordField.SendKeys("");
  
              // and click the login button
              loginButton.Click();
              WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
              IWebElement myDynamicElement = wait.Until&lt;IWebElement&gt;((d) =&gt;
              {
              return d.FindElement(By.ClassName(""));
              });
  
  
              // Extract resulting message and save it into result.txt
             string result = driver.FindElement(By.ClassName("")).Text;
  }
  </code></pre>