[Wtr-development] [JIRA] Updated: (WTR-257) Attach method in Firewatir doesnot wait for the window to be loaded completely before returning from the method. [patch]

Charley Baker (JIRA) watirjira at gmail.com
Wed Oct 27 15:42:26 EDT 2010


     [ http://jira.openqa.org/browse/WTR-257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charley Baker updated WTR-257:
------------------------------

    Fix Version/s:     (was: 1.6.7)
                   Soon

> Attach method in Firewatir doesnot wait for the window to be loaded completely before returning from the method. [patch]
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WTR-257
>                 URL: http://jira.openqa.org/browse/WTR-257
>             Project: Watir
>          Issue Type: Bug
>          Components: Window Attachment
>    Affects Versions: 1.6.0
>         Environment: Windows xp,  FireWatir 1.2
>            Reporter: Tony
>            Priority: Major
>             Fix For: Soon
>
>
> After attaching to the firefox window, the method returns even if the window is loading.
> In Watir the attach method returns only after the window has been loaded.
> Expected:
> Attach to a window and wait for the window to load.
> Solution:
> add wait() to the method attach(how, what) before self
> def attach(how, what)
>             window_number = find_window(how, what)
>             if(window_number == 0)
>                raise NoMatchingWindowFoundException.new("Unable to locate window, using #{how} and #{what}")  
>             elsif(window_number > 0)
>                 # Push the window_title and window_url of parent window. So that when we close the child window
>                 # appropriate handle of parent window is returned back.
>                 @@window_stack.push(@window_title)
>                 @@window_stack.push(@window_url)
>                 @@current_window = window_number.to_i
>                 set_browser_document()
>             end
>              wait() ######## -- wait() added so attached window will wait for page to be loaded
>             self
>         end

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the Wtr-development mailing list