[Celerity-users] click_and_attach Celerity::Exception::UnknownObjectException: no page loaded

jason franklin-stokes jasoninclass at googlemail.com
Sat Dec 12 13:54:49 EST 2009


Hi Jari, 

Thanks for the quick feedback, 

but i don't quite understand.....
as far as I can see the browser is somewhere - it  just came  back from a click_and_attach.

This works code fine.....
==================

browser_0=Celerity::Browser.new
browser_0.goto "http://www.swisspost.com"
browser_0.wait

element = browser_0.elements_by_xpath("/html/body/div[2]/div/div[4]/div[1]/ul[2]/li[2]/a").first
browser_1 = element.click_and_attach
browser_0.wait
browser_0.webclient.closeAllWindows

puts browser_1.url

element = browser_1.elements_by_xpath("/html/body/div[2]/div/div[4]/div[1]/ul[1]/li[1]/a").first
browser_2 = element.click_and_attach
browser_1.wait
browser_1.webclient.closeAllWindows

puts browser_2.url

This code does not 
==============
NB. although the only difference is that i close all windows on the browser i was using before i continue using the new browser i got from click_and_attach

browser_0=Celerity::Browser.new
browser_0.goto "http://www.swisspost.com"
browser_0.wait

element = browser_0.elements_by_xpath("/html/body/div[2]/div/div[4]/div[1]/ul[2]/li[2]/a").first
browser_1 = element.click_and_attach
browser_0.wait
#browser_0.webclient.closeAllWindows

puts browser_1.url

element = browser_1.elements_by_xpath("/html/body/div[2]/div/div[4]/div[1]/ul[1]/li[1]/a").first
browser_2 = element.click_and_attach
browser_1.wait
#browser_1.webclient.closeAllWindows

puts browser_2.url

-------

thanks for any ideas.....

jason.






On Dec 12, 2009, at 5:43 PM, Jari Bakken wrote:

> On Sat, Dec 12, 2009 at 5:17 PM, jason franklin-stokes
> <jasoninclass at googlemail.com> wrote:
>> browser = new_browser
>> 
>> browser.url     # Celerity::Exception::UnknownObjectException: no page loaded
>> 
>> 
> 
> You need to navigate somewhere (i.e. Browser#goto) before you call Browser#url.
> _______________________________________________
> Celerity-users mailing list
> Celerity-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/celerity-users



More information about the Celerity-users mailing list