Wednesday, 28 August 2013

Finding currently open browser (firefox) windows with Watir

Finding currently open browser (firefox) windows with Watir

I'm trying to write a script that will look for and use a browser window
(it can be either IE or Firefox) that is already opened before the script
is executed. The attach method works for IE, but it can't with Firefox.
browser = Watir::Browser.attach(:url, /url.com/)
Using Watir-Webdriver I tried the window switching trick posted elsewhere,
but that only seems to work when you clicked a link from the original
browser window. It can't seem to find a window that was already opened
before the script is run.
The user community on blogs elsewhere tell me this is only possible with
IE and using watir and not watir-webdriver. There's an issue opened at the
selenium issue tracker for webdriver, but it's been open for quite a
while. https://code.google.com/p/selenium/issues/detail?id=18
I'm hoping there's a workaround out there. Any ideas? Thanks in advance.
(PS - If this was solved in a prior post, I must have missed it. Apologies
for the repetition and please just point me to where. Thanks.)
-Mark

No comments:

Post a Comment