Hi

Unfortunately there is no option for the checking the browser exists or 
not :-( . But this is a nasty workaround for this issue. Here is the 
sample script that i used to test this.

ie=Browser.new()
ie.goto("http://www.wet.qantom.org";)

b = Browser("title:=/.*WET.*/")

puts b.browser_hwnd()
sleep 10
begin
puts b.browser_hwnd()
rescue
puts "Browser closed ? "
end

As soon as the browser was opened and then the website was opened. I 
closed the browser(at lesser than 10 seconds). and it did work fine. So 
use the browser_hwnd() option to check the existance of the Browser. I 
am going to put a bug on your behalf in the wet bug tracker. The users 
should be able to check weather the browser exists or not directly.

Sathya Shankar


Miguel José MFB. Feliz Bernardino wrote:

> Hi
>
> I’m having some problems with the use of wait(), so the first solution 
> I took was to replace them in the places where i had problems, with 
> some sleep() statement.
>
> The problem is that the application I’m running my scripts on, takes 
> different execution times every time I run the scripts. The solution 
> was to place some while() routines in order to know if the application 
> has finished it’s work. Until this point no much problem….the real 
> problem is that the application starts some other browsers that will 
> auto close themselves, and that I’m unable to figure out when they’re 
> closed.
>
> I’ll show you a bit of the script: (I’m using a mix of Watir/Wet on this)
>
> @b.Frame("name:=xxxxx").Link("title:=x").click()
>
> b1 = Browser("title:=yyyy")
>
> b1.Image("title:=yy").click()
>
> sleep 3
>
> b2 = Browser("title:=zzzzz")
>
> b2.frame("z").text_field(:name, "zzz").set zzz
>
> b2.Frame("name:=z1").Image("alt:=z").click()
>
> sleep 2
>
> b2.Frame("name:=z2").Link("text:=" + zzzzzzz).click()
>
> sleep 5
>
> b1.Image("title:=yyy").click()
>
> The browser b2 closes itself…..how can I know when It closes?
>
> Regards
>
> Miguel
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Wtr-general mailing list
>[email protected]
>http://rubyforge.org/mailman/listinfo/wtr-general
>  
>


-- 
Sathya Shankar M G
Software Testing Engineer
Qantom Software
http://www.qantom.com
Ph : 26799269 Xtn. 123
sip : [EMAIL PROTECTED] 


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to