1

How do I use an existing chrome browser in selenium C# ?

Currently I have the following but it always creates a new window

SessionId sessionId = new SessionId("");
var driver = new phantomJSDriver();
var driver = new PhantomJSDriver();
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
  • why is driver declared twice? – SlightlyKosumi Jul 7 at 11:56
  • WebDriver always creates a new browser, one that is fresh, so you are certain of the state. I would say most people will want to start with a known fresh state before they start executing tests. – Niels van Reijmersdal Jul 7 at 18:24
  • Possible duplicate of sqa.stackexchange.com/questions/34675/… – Niels van Reijmersdal Jul 7 at 18:25
  • Specifying why you want to use an existing window may yield better answers/reframes. [In past projects I've launched the webdriver through Python in an Interactive Mode for a mix of manual and automated testing, but without context I can't be confident if that might be a remotely viable answer for your use-case] – TheLuckless Jul 8 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.