Selenium 2: Store webdriver instance id of open window to create new webdriver instance with this id
This question is about the Java API开发者_StackOverflow社区 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();
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.
精彩评论