Karthik,

I tried using but its throwing the same error.
One interesting thing here is it is able to identify the initial
browser however its failing to find the elements.
I tried $browser.close() (after closing the 2nd browser instance) it
worked, but not identifying the elements in the browser [when I try to
click some link instead of $browser.close()]. However the same
elements are getting identified before closing the second browser
instance, so getting confused.

Thanks,
Pavithra

    Hi,

    if you use global $ instead class instance @@ it should work.

    Cheers.

On Nov 8, 12:07 pm, Pavithra <[email protected]> wrote:
> Hi,
> I am testing the website in Firefox.
>
> On a click of the link it opens the new browser window and I closed
> that using close method.
> But after closing its unable to identify the objects using browser
> variable. Below was my browser variable which worked to open the
> website and perform various actions, however the same variable is not
> working after closing the second browser window.
>
> For 1st browser
> @@browser = Watir::Browser.new
>
> For 2nd browser:
> @@browser1 = Watir::Browser
>
> Testcase flow:
> @@browser.link(:text,"XYZ").click                        [Worked]
> @@abc=@@browser1.attach(:url,"http://xyz";)      [Worked]
> @@abc.close()
> [Worked]
> @@browser.link(:text,"ABCD").click                     [Not working]
>
> Note: After closing the second browser window, its showing my initial
> browser, however i am not sure whether the script has come back to
> initial browser.
> Kindly help me out to get back to the initial browser window.
>
> Thanks,
> Pavithra

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to