0
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl(txt_URL_location.Text);
IWebElement query = driver.FindElement(By.Name(txt_login_name.Text));
query.SendKeys("Somthing");

Assume I dont want selenium to close the browser with driver.Quit(), will closing the browser manually actually act in the same manner as driver.Quit()?

I dont want to use selenium to do the testing but actually manipulate the browser so effectively automate logins for multiple sites over multiple different browsers.

1 Answer 1

0

In answer to your question, yes and no.

Manually closing will not destroy the WebDriver session, but if you subsequently call a method on the object which interacts with the browser (eg FindElement, Navigate, etc. ), an exception will be thrown because the browser no longer exists.

What exactly are you trying to do? There may be a better solution.

4
  • Trying to automate logins for a real production app - allow users to store login details and fire up their browser. Can I check if the webdriver session gets destroyed when they close the browser? Sep 8, 2013 at 12:06
  • Try it; 1. Launch webdriver. 2. Manually close browser. 3. Call webdriver method in code Sep 8, 2013 at 12:19
  • Yes, exceptions are raised. How do I get rid of the ghost process once the browser has closed? Sep 8, 2013 at 15:33
  • 1
    You could write a cmdline script to kill WebDriver processes, but it sounds like WebDriver isn't the right tool for the job. Sep 8, 2013 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.