Alp
Alp

Reputation: 29739

Selenium 2: Store webdriver instance id of open window to create new webdriver instance with this id

This question is about the Java API of Selenium 2 RC2, used with Firefox 4.

Let's say i have a WebDriver instance open and made some interactions in that browser window, like opening a URL, clicking on a link and filling out a form.

Is it possible to create a new WebDriver instance which uses the already open window? Something like this (pseudo code):

WebDriver webDriver1 = new FireFoxWebDriver();
webDriver.doSomeStuff();
String webDriverInstanceId = webDriver.getId();

WebDriver webDriver2 = new FireFoxWebDriver(webDriverInstanceId);
webDriver.continueDoingMoreStuffInSameWindow();

Upvotes: 1

Views: 2007

Answers (1)

JimEvans
JimEvans

Reputation: 27496

There is no "attach to an existing instance of a browser" functionality in the Selenium WebDriver API yet. This is true regardless of whether WebDriver or a different process started the instance of the browser you want to attach to. There is an open feature request for it.

Upvotes: 2

Related Questions