From tomasz2k at poczta.onet.pl Tue Nov 10 10:32:02 2009 From: tomasz2k at poczta.onet.pl (tomasz2k at poczta.onet.pl) Date: Tue, 10 Nov 2009 16:32:02 +0100 Subject: [Celerity-users] I cannot see HtmlUnit debug messages Message-ID: Hello I cannot get any debug messages from HtmlUnit's packages below. I use this code to set debug level: b = Celerity::Browser.new(:refresh_handler => :threaded, :resynchronize => true, :browser=>:internet_explorer) b.log_level= :all I've also tried with :finest. Only messages I can see are INFO and above. I guess that there should be many DEBUG messages from HtmlUnit but I cannot see any DEBUG message at all. Am I missing something? Thanks in advance. Regards, Tomasz Kalkosinski From jari.bakken at gmail.com Tue Nov 10 10:52:15 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 10 Nov 2009 16:52:15 +0100 Subject: [Celerity-users] I cannot see HtmlUnit debug messages In-Reply-To: References: Message-ID: On Tue, Nov 10, 2009 at 4:32 PM, wrote: > > I've also tried with :finest. Only messages I can see are INFO and above. I guess that there should be many DEBUG messages from HtmlUnit but I cannot see any DEBUG message at all. Am I missing something? > Not sure - try the HtmlUnit list. From dorikick at gmail.com Wed Nov 11 06:15:54 2009 From: dorikick at gmail.com (doridori Jo) Date: Wed, 11 Nov 2009 03:15:54 -0800 Subject: [Celerity-users] click_and_attach question Message-ID: <3a8841390911110315u592dea76la5883ba95c3c0039@mail.gmail.com> is it possible to use* click_and_attach* on a link that loads a page via ajax ? assuming :resynchronize is on, do i add browser.wait immediately after ? *newtab = ajaxlink.click_and_attach * can you stack your *click_and_attach* ? and then close everything by closing the first browser instance ? I am doing this because* browser.back* is not reliable in AJAX heavy sites where actually clicking back in your browser will produce undesired results or simply not go back. *firsttab = link.click_and_attach secondtab = firsttab.link.click_and_attach thirdtab = secondtab.link.click_and_attach firstab.close* *#would this close all "tabs" opened? or would i need to close it individually like secondtab.close, thirdtab.close.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jasoninclass at googlemail.com Wed Nov 11 15:17:48 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Wed, 11 Nov 2009 21:17:48 +0100 Subject: [Celerity-users] thread safe Message-ID: <6F4F8DE9-47B3-4FB8-A531-13BB6A72EFF9@googlemail.com> dear all, i want to use celerity in a number of different threads, however i am getting the following error... /Library/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/javasupport/ core_ext/module.rb:37 warning: already initialized constant NicelyResynchronizingAjaxController /Library/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/javasupport/ core_ext/module.rb:37 warning: already initialized constant WebRequestSettings any ideas??? apparently htmlunit is thread safe s i am wondering what this could be thanks jason. From dorikick at gmail.com Wed Nov 11 17:22:58 2009 From: dorikick at gmail.com (doridori Jo) Date: Wed, 11 Nov 2009 14:22:58 -0800 Subject: [Celerity-users] thread safe In-Reply-To: <6F4F8DE9-47B3-4FB8-A531-13BB6A72EFF9@googlemail.com> References: <6F4F8DE9-47B3-4FB8-A531-13BB6A72EFF9@googlemail.com> Message-ID: <3a8841390911111422ode17eabv8b695e42b9765d67@mail.gmail.com> how did you create multiple threads with celerity ? i am just running multiple instances. On Wed, Nov 11, 2009 at 12:17 PM, jason franklin-stokes < jasoninclass at googlemail.com> wrote: > dear all, > > i want to use celerity in a number of different threads, however i am > getting the following error... > > > /Library/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/module.rb:37 > warning: already initialized constant NicelyResynchronizingAjaxController > > /Library/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/module.rb:37 > warning: already initialized constant WebRequestSettings > > any ideas??? > > apparently htmlunit is thread safe s i am wondering what this could be > > thanks > jason. > > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashley.moran at patchspace.co.uk Fri Nov 13 14:33:29 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Fri, 13 Nov 2009 19:33:29 +0000 Subject: [Celerity-users] Dojo/JsonRestStore problem with resynchronize and PUT requests Message-ID: Hi Anyone got any ideas what is going on here? I'll copy the comment from the source file: `:resynchronize => true` causes the an 'edit complete' event to fire and attempts to send a PUT request with an empty body, but an exception is thrown before it leaves Celerity `:resynchronize => false` apparently prevents the PUT from ever being attempted It seems like browser resynchronising is affecting the way Dojo gets run. Presumably an HtmlUnit issue, but I thought I'd ask here first in case anyone can help. (To run the merb app, you need to do `merb -I json_server.rb`) Thanks Ashley -------------- next part -------------- A non-text attachment was scrubbed... Name: json_server.rb Type: text/x-ruby-script Size: 6495 bytes Desc: not available URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: put_test.rb Type: text/x-ruby-script Size: 2200 bytes Desc: not available URL: -------------- next part -------------- -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran From dorikick at gmail.com Fri Nov 13 16:32:26 2009 From: dorikick at gmail.com (doridori Jo) Date: Fri, 13 Nov 2009 13:32:26 -0800 Subject: [Celerity-users] Dojo/JsonRestStore problem with resynchronize and PUT requests In-Reply-To: References: Message-ID: <3a8841390911131332u23f2a26el364efc27fa169f90@mail.gmail.com> are you using the latest version of celerity ? 0.7.5 On Fri, Nov 13, 2009 at 11:33 AM, Ashley Moran < ashley.moran at patchspace.co.uk> wrote: > Hi > > Anyone got any ideas what is going on here? I'll copy the comment from the > source file: > > `:resynchronize => true` causes the an 'edit complete' event to fire and > attempts to > send a PUT request with an empty body, but an exception is thrown before it > leaves Celerity > `:resynchronize => false` apparently prevents the PUT from ever being > attempted > > It seems like browser resynchronising is affecting the way Dojo gets run. > Presumably an HtmlUnit issue, but I thought I'd ask here first in case > anyone can help. > > (To run the merb app, you need to do `merb -I json_server.rb`) > > Thanks > Ashley > > > > > > > -- > http://www.patchspace.co.uk/ > http://www.linkedin.com/in/ashleymoran > > > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashley.moran at patchspace.co.uk Fri Nov 13 18:05:52 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Fri, 13 Nov 2009 23:05:52 +0000 Subject: [Celerity-users] Dojo/JsonRestStore problem with resynchronize and PUT requests In-Reply-To: <3a8841390911131332u23f2a26el364efc27fa169f90@mail.gmail.com> References: <3a8841390911131332u23f2a26el364efc27fa169f90@mail.gmail.com> Message-ID: <59C91964-09A2-4203-8DD3-5C50A1440CD0@patchspace.co.uk> On 13 Nov 2009, at 21:32, doridori Jo wrote: > are you using the latest version of celerity ? 0.7.5 Hi doridori Yes I am. Well, client was - I just realised I was on 0.7.4, but I've upgraded and still get the same behaviour. Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran From AEtzold at gmx.de Mon Nov 16 18:57:22 2009 From: AEtzold at gmx.de (Axel Etzold) Date: Tue, 17 Nov 2009 00:57:22 +0100 Subject: [Celerity-users] A simple naming question - comboboxes ? Message-ID: <20091116235722.322110@gmx.net> Dear all, how are elements like the ones with the text "All Fields" on them on the website http://patft.uspto.gov/netahtml/PTO/search-bool.html named and how could I access them ? I thought of something like browser = Celerity::Browser.new browser.goto("http://patft.uspto.gov/netahtml/PTO/search-bool.html") browser.comboboxes, but there is no such method ... Thank you very much! Best regards, Axel -- DSL-Preisknaller: DSL Komplettpakete von GMX schon f?r 16,99 Euro mtl.!* Hier klicken: http://portal.gmx.net/de/go/dsl02 From jari.bakken at gmail.com Mon Nov 16 19:11:23 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 17 Nov 2009 01:11:23 +0100 Subject: [Celerity-users] A simple naming question - comboboxes ? In-Reply-To: <20091116235722.322110@gmx.net> References: <20091116235722.322110@gmx.net> Message-ID: Try browser.select_list(:name, 'FIELD1') In the future, reading the docs at http://rdoc.info/projects/jarib/celerity should be helpful for questions like this, especially the Celerity::Container module and the various Element subclasses. On Tue, Nov 17, 2009 at 12:57 AM, Axel Etzold wrote: > Dear all, > > how are elements like the ones with the text "All Fields" on them > on the website > > http://patft.uspto.gov/netahtml/PTO/search-bool.html > > named and how could I access them ? > > I thought of something like > > browser = Celerity::Browser.new > browser.goto("http://patft.uspto.gov/netahtml/PTO/search-bool.html") > browser.comboboxes, > > but there is no such method ... > > Thank you very much! > > Best regards, > > Axel > -- > DSL-Preisknaller: DSL Komplettpakete von GMX schon f?r > 16,99 Euro mtl.!* Hier klicken: http://portal.gmx.net/de/go/dsl02 > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users > From geoffrey at geoffreyarnold.com Tue Nov 17 23:36:11 2009 From: geoffrey at geoffreyarnold.com (Geoffrey Arnold) Date: Tue, 17 Nov 2009 23:36:11 -0500 Subject: [Celerity-users] Downloading dynamic Javascript images Message-ID: Hello, We have a page that dynamically downloads images in the background using Javascript similar to the following: var image = new Image(); image.src = '...'; ... and are attempting to test it using Cucumber/Celerity, however it appears that the images are not recognized. Here's a snippet from our Cucumber step: @browser.goto_quietly("...") @browser.wait @browser.wait_until do |browser| browser.images.each do |image| return false unless image.loaded? end end If I print the browser.images property it is empty. Any help would be greatly appreciated. Best, Geoff. From dorikick at gmail.com Wed Nov 18 16:56:40 2009 From: dorikick at gmail.com (doridori Jo) Date: Wed, 18 Nov 2009 13:56:40 -0800 Subject: [Celerity-users] Error: Your application used more memory than the safety cap of 500m.Specify -J-Xmx####m to increase it (#### = cap size in MB).Specify -w for full OutOfMemoryError stack trace Message-ID: <3a8841390911181356o3b604549v40e40f30193b8ab6@mail.gmail.com> Error: Your application used more memory than the safety cap of 500m. Specify -J-Xmx####m to increase it (#### = cap size in MB). Specify -w for full OutOfMemoryError stack trace I get this message. where do i specify the -w option ? jruby -w myscript.rb ? also, I am using lot of .click_and_attach() which creates many new browser instances. could this be the problem ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorikick at gmail.com Sun Nov 22 03:58:44 2009 From: dorikick at gmail.com (doridori Jo) Date: Sun, 22 Nov 2009 00:58:44 -0800 Subject: [Celerity-users] browser.click_and_attach works but not browser.click Message-ID: <3a8841390911220058y1161e61ndeb0217123193197@mail.gmail.com> i found a very weird situation today where puts browser.url # => something.com > puts browser.element_by_xpath(somelink).click_and_attach.url #=> > something.com/new/ > works as it should. i deleted above, and decided to just use .click as below. puts browser.url # => something.com > browser.element_by_xpath(somelink).click > browser.wait > puts browser.url # => something.com > no exception is raised, meaning it clicked it right? then, why is it that something.com/new/ is not loading ? what does this mean ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Sun Nov 22 10:13:18 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Sun, 22 Nov 2009 16:13:18 +0100 Subject: [Celerity-users] browser.click_and_attach works but not browser.click In-Reply-To: <3a8841390911220058y1161e61ndeb0217123193197@mail.gmail.com> References: <3a8841390911220058y1161e61ndeb0217123193197@mail.gmail.com> Message-ID: On Sun, Nov 22, 2009 at 9:58 AM, doridori Jo wrote: > > what does this mean ? > It's impossible to say without knowing more about the web app. If you can provide a way for us to reproduce the problem locally, we might be able to help further. Following the instructions on http://wiki.github.com/jarib/celerity/ajax, especially turning on javascript exceptions and full logging, might give you further insights. From ben at bridesmere.com Wed Nov 25 10:37:34 2009 From: ben at bridesmere.com (Ben Butler-Cole) Date: Wed, 25 Nov 2009 15:37:34 +0000 Subject: [Celerity-users] Magic transmogrifying row object Message-ID: Hello I need to get at the underlying HtmlUnit object for a table row. When I first tried it I discovered that it didn't have the methods I was expecting. By trial and error I have discovered that the first time I access the row's HtmlUnit object (via the .object method) it returns a List. The second time it returns an HtmlTableRow. Ummm???? Here is the log of a real, live irb session where you can see this happing. As a bonus we learn that Google's front page has tables in it. irb(main):019:0> browser = Celerity::Browser.new irb(main):020:0> browser.goto('http://www.google.com') irb(main):021:0> e = browser.row(:index, 1) irb(main):022:0> puts e.object.getClass class java.util.Collections$UnmodifiableRandomAccessList irb(main):023:0> puts e.object.getClass class com.gargoylesoftware.htmlunit.html.HtmlTableRow I can live with this because a random e.object in my code fixes the problem. But any idea what's going on? Shall I raise a bug? Thanks Ben From jari.bakken at gmail.com Wed Nov 25 11:24:51 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 25 Nov 2009 17:24:51 +0100 Subject: [Celerity-users] Magic transmogrifying row object In-Reply-To: References: Message-ID: Den 25. nov. 2009 kl. 16.37 skrev Ben Butler-Cole : > Hello > > I need to get at the underlying HtmlUnit object for a table row. When > I first tried it I discovered that it didn't have the methods I was > expecting. By trial and error I have discovered that the first time I > access the row's HtmlUnit object (via the .object method) it returns a > List. The second time it returns an HtmlTableRow. Ummm???? Without having the code in front of me, I would guess this is caused by the lazy locating of elements. If you try row(...).locate you should get the correct HU object directly. Out of interest, why do you need the underlying object? > > Here is the log of a real, live irb session where you can see this > happing. As a bonus we learn that Google's front page has tables in > it. > > irb(main):019:0> browser = Celerity::Browser.new > irb(main):020:0> browser.goto('http://www.google.com') > irb(main):021:0> e = browser.row(:index, 1) > > irb(main):022:0> puts e.object.getClass > class java.util.Collections$UnmodifiableRandomAccessList > > irb(main):023:0> puts e.object.getClass > class com.gargoylesoftware.htmlunit.html.HtmlTableRow > > I can live with this because a random e.object in my code fixes the > problem. But any idea what's going on? Shall I raise a bug? > > Thanks > Ben > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From ben at bridesmere.com Wed Nov 25 11:59:56 2009 From: ben at bridesmere.com (Ben Butler-Cole) Date: Wed, 25 Nov 2009 16:59:56 +0000 Subject: [Celerity-users] Magic transmogrifying row object In-Reply-To: References: Message-ID: 2009/11/25 Jari Bakken : > >> I need to get at the underlying HtmlUnit object for a table row. When >> I first tried it I discovered that it didn't have the methods I was >> expecting. By trial and error I have discovered that the first time I >> access the row's HtmlUnit object (via the .object method) it returns a >> List. The second time it returns an HtmlTableRow. Ummm???? > > Without having the code in front of me, I would guess this is caused by the > lazy locating of elements. If you try row(...).locate you should get the > correct HU object directly. Calling .locate *always* gives the wrong type (the list instead of the HtmlTableRow). I have put the code in front of myself and had a look. I think there is a bug in Celerity::TableRow.locate. The relevant bits look like this: module Celerity class Element def locate @object = ElementLocator.new(@container, self.class).find_by_conditions(@conditions) end def object @object || locate end end class TableRow < Element def locate super @cells = @object.getCells if @object end end end So the .object method in Element expects .locate to return the object as well as assign it. But TableRow's overridden .locate returns the cells instead. The easiest fix is: module Celerity class TableRow def locate super @cells = @object.getCells if @object @object end end end Which I have verified locally. > Out of interest, why do you need the underlying object? I want to call the mouse* methods. I've added this: class Celerity::Element def mouse_down object.mouseDown end def mouse_up object.mouseUp end def mouse_move object.mouseMove end end Ben From jari.bakken at gmail.com Wed Nov 25 12:47:44 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 25 Nov 2009 18:47:44 +0100 Subject: [Celerity-users] Magic transmogrifying row object In-Reply-To: References: Message-ID: On 25. nov. 2009, at 17.59, Ben Butler-Cole wrote: > 2009/11/25 Jari Bakken : >> >>> I need to get at the underlying HtmlUnit object for a table row. When >>> I first tried it I discovered that it didn't have the methods I was >>> expecting. By trial and error I have discovered that the first time I >>> access the row's HtmlUnit object (via the .object method) it returns a >>> List. The second time it returns an HtmlTableRow. Ummm???? >> >> Without having the code in front of me, I would guess this is caused by the >> lazy locating of elements. If you try row(...).locate you should get the >> correct HU object directly. > > Calling .locate *always* gives the wrong type (the list instead of the > HtmlTableRow). > > I have put the code in front of myself and had a look. I think there > is a bug in Celerity::TableRow.locate. The relevant bits look like > this: > > module Celerity > class Element > def locate > @object = ElementLocator.new(@container, > self.class).find_by_conditions(@conditions) > end > > def object > @object || locate > end > end > > class TableRow < Element > def locate > super > @cells = @object.getCells if @object > end > end > end > > So the .object method in Element expects .locate to return the object > as well as assign it. But TableRow's overridden .locate returns the > cells instead. The easiest fix is: > > module Celerity > class TableRow > def locate > super > @cells = @object.getCells if @object > @object > end > end > end > > Which I have verified locally. Nice work. Could you fork Celerity on GitHub and commit this fix? From jari.bakken at gmail.com Wed Nov 25 13:24:15 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 25 Nov 2009 19:24:15 +0100 Subject: [Celerity-users] Magic transmogrifying row object In-Reply-To: References: Message-ID: On 25. nov. 2009, at 17.59, Ben Butler-Cole wrote: > 2009/11/25 Jari Bakken : >> >>> I need to get at the underlying HtmlUnit object for a table row. When >>> I first tried it I discovered that it didn't have the methods I was >>> expecting. By trial and error I have discovered that the first time I >>> access the row's HtmlUnit object (via the .object method) it returns a >>> List. The second time it returns an HtmlTableRow. Ummm???? >> >> Without having the code in front of me, I would guess this is caused by the >> lazy locating of elements. If you try row(...).locate you should get the >> correct HU object directly. > > Calling .locate *always* gives the wrong type (the list instead of the > HtmlTableRow). > > I have put the code in front of myself and had a look. I think there > is a bug in Celerity::TableRow.locate. The relevant bits look like > this: > > module Celerity > class Element > def locate > @object = ElementLocator.new(@container, > self.class).find_by_conditions(@conditions) > end > > def object > @object || locate > end > end > > class TableRow < Element > def locate > super > @cells = @object.getCells if @object > end > end > end > > So the .object method in Element expects .locate to return the object > as well as assign it. But TableRow's overridden .locate returns the > cells instead. The easiest fix is: > > module Celerity > class TableRow > def locate > super > @cells = @object.getCells if @object > @object > end > end > end > > Which I have verified locally. Could you fork Celerity on GitHub and commit this fix? From ben at bridesmere.com Wed Nov 25 14:53:51 2009 From: ben at bridesmere.com (Ben Butler-Cole) Date: Wed, 25 Nov 2009 19:53:51 +0000 Subject: [Celerity-users] Magic transmogrifying row object In-Reply-To: References: Message-ID: >> I think there is a bug in Celerity::TableRow.locate. > > Nice work. Could you fork Celerity on GitHub and commit this fix? Will do. Where is the right place to put a test for this? I can't see anywhere obvious. Ben From jari.bakken at gmail.com Wed Nov 25 16:05:04 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 25 Nov 2009 22:05:04 +0100 Subject: [Celerity-users] Magic transmogrifying row object In-Reply-To: References: Message-ID: The specs are in a separate project (watirspec), included as a git submodule. Check the rake tasks. Den 25. nov. 2009 kl. 20.53 skrev Ben Butler-Cole : >>> I think there is a bug in Celerity::TableRow.locate. >> >> Nice work. Could you fork Celerity on GitHub and commit this fix? > > Will do. Where is the right place to put a test for this? I can't see > anywhere obvious. > > Ben > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From dorikick at gmail.com Thu Nov 26 00:39:19 2009 From: dorikick at gmail.com (doridori Jo) Date: Wed, 25 Nov 2009 21:39:19 -0800 Subject: [Celerity-users] browser.xml.to_s seems to consume lot of resource ? Message-ID: <3a8841390911252139g3adf8381ide6440969da22a9@mail.gmail.com> i need to display the HTML source, and have it written to disk. currently i am doing browser.xml.to_s and writing it to a text file. is this efficient or is there a better approach ? I am trying to just download what celerity::browser sees. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorikick at gmail.com Sat Nov 28 21:36:28 2009 From: dorikick at gmail.com (doridori Jo) Date: Sat, 28 Nov 2009 18:36:28 -0800 Subject: [Celerity-users] Celerity renders site differently than firefox Message-ID: <3a8841390911281836i5288e1f4me251e96bcc48426@mail.gmail.com> I discovered today that in my firefox browser, a link is /html/body/center/p[2]/table/tbody/tr/td[2]/small/a but when celerity loads the site, to my surprise, it couldn't locate it via XPATH. curious i decided to puts browser.link(:text => "Someuniquelink").xpath /html/body/p[3]/table/tbody/tr/td[2]/small/a What gives ???! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorikick at gmail.com Mon Nov 30 15:45:23 2009 From: dorikick at gmail.com (doridori Jo) Date: Mon, 30 Nov 2009 12:45:23 -0800 Subject: [Celerity-users] Celerity opening pop up ads ! Message-ID: <3a8841390911301245ka4438ebn37bcabe60004c274@mail.gmail.com> i discover that when i submit a form through celerity, and open the resulting page in new browser session via #click_and_attach, the new browser session contains an advertisement and not the expected result page ! what to do ? I can't ignore all popunder because the app depends on it as well (for setting certain form options). -------------- next part -------------- An HTML attachment was scrubbed... URL: