From jari.bakken at gmail.com Tue Aug 4 22:06:01 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 5 Aug 2009 04:06:01 +0200 Subject: [Celerity-users] unable to run celerity.... In-Reply-To: <3a8841390908041857r3854d1b0w38b6c1dd5373243f@mail.gmail.com> References: <3a8841390908041857r3854d1b0w38b6c1dd5373243f@mail.gmail.com> Message-ID: On Wed, Aug 5, 2009 at 3:57 AM, doridori Jo wrote: > home/.gems/gems/celerity-0.0.6/lib/celerity.rb:3: Celerity only works on > JRuby at the moment. (RuntimeError) > from /home/lib/rubygems/custom_require.rb:32:in > `gem_original_require' > from /home/lib/rubygems/custom_require.rb:32:in `require' > from test.rb:3 > > i get that error message. > > i installed clerity, jruby through gem install. > You're using the wrong interpreter to run your script. Make sure /bin is in your PATH, then run your script with: jruby test.rb I also recommend installing the latest version of Celerity available from GitHub - the one on RubyForge is quite old: jruby -S gem source --add http://gems.github.com jruby -S gem install jarib-celerity -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Wed Aug 5 05:54:42 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 5 Aug 2009 11:54:42 +0200 Subject: [Celerity-users] WARNING: Obsolete content type encountered: 'text/javascript'. In-Reply-To: <3a8841390908042021o5ab6e2e2oec8426c07dc092ac@mail.gmail.com> References: <3a8841390908042021o5ab6e2e2oec8426c07dc092ac@mail.gmail.com> Message-ID: On Wed, Aug 5, 2009 at 5:21 AM, doridori Jo wrote: > Aug 4, 2009 9:22:24 PM > com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'text/javascript'. > > > i keep getting this message when run > > jruby test.rb, which is the example script on the main site.... > > should i be worried? it's a bit annoying seeing this message. It's just a warning. You can adjust the log level to get rid of it, see: http://wiki.github.com/jarib/celerity/faq -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Fri Aug 7 13:40:55 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 7 Aug 2009 19:40:55 +0200 Subject: [Celerity-users] [ANN] watirspec Message-ID: I've factored out the bulk of Celerity's rspec suite to a separate project, available on GitHub at http://github.com/jarib/watirspec/tree/master The idea is to allow other implementations to use the repository as a git submodule in their projects. See the README for details. The project consists of 950+ rspec examples and is released under a BSD license. There's probably some work left to rid the suite of Celerity/JRuby-specific tests, but it should be quite usable already. (I haven't yet been able to complete a full spec run on any other implementation though - working on it!) From reuven at lerner.co.il Mon Aug 10 07:51:31 2009 From: reuven at lerner.co.il (Reuven M. Lerner) Date: Mon, 10 Aug 2009 14:51:31 +0300 Subject: [Celerity-users] Handling JavaScript-based reloads in Celerity Message-ID: <4A8009C3.6070108@lerner.co.il> Hi there. I'm on a development team using Celerity (via the Culerity proxy system, using Cucumber and RSpec) to test our Merb application. It has been working beautifully with simple pages, but now that we're starting to use it to test Ajaxy sorts of things, we're having problems. For example, we have a back-end process that can take a highly variable amount of time. The process indicates that it has completed its task by setting a field in the database. The process is started when a user clicks on the "start" link on a Web page. This loads a page that says "Currently performing task," and which contains a JavaScript function that checks the status of the value of the database every 8 seconds via setInterval. When our JavaScript function gets a response indicating that the back-end process has completed its work, it refreshes the screen (via window.location.href). We understand that this should mostly be done via mocking -- but we also want to know just where the limits are of Celerity's JavaScript engine, and how we can use it to handle a number of Ajax tasks on our site that have nothing to do with back-end work, and which will be crucial for our testing process. Thanks for any advice you can offer! Reuven -- Reuven M. Lerner -- Web development, consulting, and training Mobile: +972-54-496-8405 * US phone: 847-230-9795 Skype/AIM: reuvenlerner From jari.bakken at gmail.com Mon Aug 10 12:53:25 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 10 Aug 2009 18:53:25 +0200 Subject: [Celerity-users] Handling JavaScript-based reloads in Celerity In-Reply-To: <4A8009C3.6070108@lerner.co.il> References: <4A8009C3.6070108@lerner.co.il> Message-ID: Hello Reuven On Mon, Aug 10, 2009 at 1:51 PM, Reuven M. Lerner wrote: > > We understand that this should mostly be done via mocking -- but we also > want to know just where the limits are of Celerity's JavaScript engine, and > how we can use it to handle a number of Ajax tasks on our site that have > nothing to do with back-end work, and which will be crucial for our testing > process. > I don't think mocking is the right approach for high-level tests like these. How will you verify the behaviour of the parts of your site that use Ajax? Please look at the Ajax page on the wiki [1] for some tips on dealing with and debugging Ajax. You've described the functionality on your site, but didn't say anything about how the problem manifests itself when you run your scripts. Celerity should be able to deal with that sort of stuff just fine. If you can isolate the problem (or provide a reproducible example), I'll be happy to help figuring out what's going on. I can't really give you a good answer about the limitations of the JavaScript engine - Celerity just wraps HtmlUnit, so we're basically left with what they provide. HtmlUnit passes the test suites of major JavaScript frameworks like GWT, jQuery, MooTools, Dojo ++, and the developers are committed to fixing any problems where HtmlUnit behaves differently from a real browser. Stuff that works in Firefox (or whatever browser simulation your using) but not in Celerity should be considered a bug and reported to their tracker [2]. Also see their page on "Submiiting JavaScript bugs" [3]. Hope this helps. [1] http://wiki.github.com/jarib/celerity/ajax [2] http://sourceforge.net/tracker/?group_id=47038&atid=448266 [3] http://htmlunit.sourceforge.net/submittingJSBugs.html From jari.bakken at gmail.com Mon Aug 10 14:49:20 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 10 Aug 2009 20:49:20 +0200 Subject: [Celerity-users]
not found In-Reply-To: <71C61A8A-85C4-4031-9A84-1389551CE3CD@googlemail.com> References: <71C61A8A-85C4-4031-9A84-1389551CE3CD@googlemail.com> Message-ID: On Mon, Aug 10, 2009 at 2:27 PM, jason franklin-stokes wrote: > browser = Celerity::Browser.new > browser.goto("http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/jobboerse.aspx") Ouch, that page is nasty. It's not rendered correctly in Firefox 3.5 either. I was able to look at the DOM using Safari's Web Inspector (which does render the page correctly, should work in Chrome as well) and it's very different from HtmlUnit's (which can be viewed using Browser#xml). I don't think the problem is related to the self-closing form tag, and it's definitely not a bug in Celerity - you should post this directly to the HtmlUnit list [1] or tracker [2]. [1] https://lists.sourceforge.net/lists/listinfo/htmlunit-user [2] http://sourceforge.net/tracker/?group_id=47038&atid=448266 From jasoninclass at googlemail.com Mon Aug 10 16:41:13 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Mon, 10 Aug 2009 22:41:13 +0200 Subject: [Celerity-users] page cacheing Message-ID: Hi Groupies, I am trying to figure out if it is possible to cache (save) a page and load it back into the "browser" and continue using it later (ie clicking of links and buttons) without having to issue a browser.goto(url). Any advise? Thanks a million Jason. From ashley.moran at patchspace.co.uk Mon Aug 10 17:04:52 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Mon, 10 Aug 2009 22:04:52 +0100 Subject: [Celerity-users] page cacheing In-Reply-To: References: Message-ID: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> On 10 Aug 2009, at 21:41, jason franklin-stokes wrote: > I am trying to figure out if it is possible to cache (save) a page > and load it back into the "browser" and continue using it later (ie > clicking of links and buttons) without having to issue a > browser.goto(url). Hi Jason I don't believe this is currently possible, but I've filed an HtmlUnit ticket for it if you want to comment on it: http://sourceforge.net/tracker/index.php?func=detail&aid=2831644&group_id=47038&atid=448269 Cheers Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ From jari.bakken at gmail.com Mon Aug 10 17:31:08 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 10 Aug 2009 23:31:08 +0200 Subject: [Celerity-users] CelerityViewer change Message-ID: Hello, If you're using any of the celerity viewers (available from http://github.com/jarib/celerity-viewers/tree/master), you need to watch out for a backwards incompatible change I've just made. The latest Celerity gem on GitHub (0.0.6.16) no longer use DRb for IPC, which has been replaced a simple JSON protocol over TCP. The viewers have been updated to reflect the change. The benefit of this is that future viewers/services can be implemented in any language, not just Ruby. I've also added the possibility to specify the host/port that Celerity should connect to: Celerity::Browser.new(:viewer => "localhost:6429") Or you can turn of the viewer functionality off completely: Celerity::Browser.new(:viewer => false) By specifying a host/port, you can in theory use this funcionality to implement services that receive HTML dumps from Celerity on every page change. More details are up on the wiki at http://wiki.github.com/jarib/celerity/viewers. From jari.bakken at gmail.com Mon Aug 10 17:32:11 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 10 Aug 2009 23:32:11 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: Message-ID: On Mon, Aug 10, 2009 at 10:41 PM, jason franklin-stokes wrote: > Hi Groupies, > > I am trying to figure out if it is possible to cache (save) a page and load > it back into the "browser" and continue using it later (ie clicking of links > and buttons) without having to issue a browser.goto(url). > Do you mean save to disk or in memory? From jari.bakken at gmail.com Mon Aug 10 17:47:39 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 10 Aug 2009 23:47:39 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: Message-ID: This seems to work http://gist.github.com/165436 From jasoninclass at googlemail.com Tue Aug 11 03:22:03 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 09:22:03 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: Message-ID: <2D50447B-E640-4794-B82B-A60592A1DB68@googlemail.com> Jari!! Thanks a million. Confirmed - works great - amazing... The page object can also be saved and loaded to disk using Marshal.dump and load without any problems. I am such a fan - firewatir/watir feels like stonehenge in comparison. Jason. On Aug 10, 2009, at 11:47 PM, Jari Bakken wrote: > This seems to work > > http://gist.github.com/165436 > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Tue Aug 11 05:07:27 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 11:07:27 +0200 Subject: [Celerity-users] CelerityViewer change In-Reply-To: References: Message-ID: <53D339D5-15D3-459A-941E-51776917F9E8@googlemail.com> Jari Thanks for the info. Version 0.0.6.16 is in the the trunk but not available for download as a gem with jruby -S gem install (this is still the current version 0.0.6) Any advise Jason. On Aug 10, 2009, at 11:31 PM, Jari Bakken wrote: > Hello, > > If you're using any of the celerity viewers (available from > http://github.com/jarib/celerity-viewers/tree/master), you need to > watch out for a backwards incompatible change I've just made. The > latest Celerity gem on GitHub (0.0.6.16) no longer use DRb for IPC, > which has been replaced a simple JSON protocol over TCP. The viewers > have been updated to reflect the change. The benefit of this is that > future viewers/services can be implemented in any language, not just > Ruby. > > I've also added the possibility to specify the host/port that Celerity > should connect to: > > Celerity::Browser.new(:viewer => "localhost:6429") > > Or you can turn of the viewer functionality off completely: > > Celerity::Browser.new(:viewer => false) > > By specifying a host/port, you can in theory use this funcionality to > implement services that receive HTML dumps from Celerity on every page > change. > More details are up on the wiki at > http://wiki.github.com/jarib/celerity/viewers. > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Tue Aug 11 05:30:37 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 11:30:37 +0200 Subject: [Celerity-users] CelerityViewer change In-Reply-To: References: Message-ID: Jari, I just cloned and built and installed the gem version 0.0.6.16 of celerity. I downloaded the viewers and did a rake for the cocaruby viewer which started and told me it needs json - which i installed in the ruby (not the jruby) gem path - after which it started and displayed the celerity home page. then using: browser = Celerity::Browser.new :viewer => "localhost: 6429", :log_level => :off I got the following error - which is a little confusing. /Library/jruby-1.3.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `require': no such file to load -- json (LoadError) Any Advise? Jason. BTW brilliant work with the viewers!! On Aug 10, 2009, at 11:31 PM, Jari Bakken wrote: > Hello, > > If you're using any of the celerity viewers (available from > http://github.com/jarib/celerity-viewers/tree/master), you need to > watch out for a backwards incompatible change I've just made. The > latest Celerity gem on GitHub (0.0.6.16) no longer use DRb for IPC, > which has been replaced a simple JSON protocol over TCP. The viewers > have been updated to reflect the change. The benefit of this is that > future viewers/services can be implemented in any language, not just > Ruby. > > I've also added the possibility to specify the host/port that Celerity > should connect to: > > Celerity::Browser.new(:viewer => "localhost:6429") > > Or you can turn of the viewer functionality off completely: > > Celerity::Browser.new(:viewer => false) > > By specifying a host/port, you can in theory use this funcionality to > implement services that receive HTML dumps from Celerity on every page > change. > More details are up on the wiki at > http://wiki.github.com/jarib/celerity/viewers. > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jari.bakken at gmail.com Tue Aug 11 06:06:35 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 11 Aug 2009 12:06:35 +0200 Subject: [Celerity-users] CelerityViewer change In-Reply-To: References: Message-ID: On Tue, Aug 11, 2009 at 11:48 AM, jason franklin-stokes wrote: > > OK - got it. > I needed the json-jruby gem > jruby -S gem install json-jruby > Hmm, that doesn't make sense - the RubyCocoa app should run on your normal Leopard Ruby installation - not JRuby. From jasoninclass at googlemail.com Tue Aug 11 06:32:22 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 12:32:22 +0200 Subject: [Celerity-users] CelerityViewer change In-Reply-To: References: Message-ID: <4A03E746-29AB-487D-8562-0B80A8CC27AF@googlemail.com> In the celerity file: viewer_connection.rb def self.create(host, port) socket = TCPSocket.new(host, port) require "json" new(socket) end This looks to me like the jruby environment need the json gem. On Aug 11, 2009, at 12:06 PM, Jari Bakken wrote: > On Tue, Aug 11, 2009 at 11:48 AM, jason > franklin-stokes wrote: >> >> OK - got it. >> I needed the json-jruby gem >> jruby -S gem install json-jruby >> > > Hmm, that doesn't make sense - the RubyCocoa app should run on your > normal Leopard Ruby installation - not JRuby. > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jari.bakken at gmail.com Tue Aug 11 07:40:42 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 11 Aug 2009 13:40:42 +0200 Subject: [Celerity-users] CelerityViewer change In-Reply-To: <4A03E746-29AB-487D-8562-0B80A8CC27AF@googlemail.com> References: <4A03E746-29AB-487D-8562-0B80A8CC27AF@googlemail.com> Message-ID: On Tue, Aug 11, 2009 at 12:32 PM, jason franklin-stokes wrote: > In the celerity file: viewer_connection.rb > > def self.create(host, port) > ? ? ?socket = TCPSocket.new(host, port) > ? ? ?require "json" > ? ? ?new(socket) > end > Right, I'm just confused, sorry :) From jasoninclass at googlemail.com Tue Aug 11 09:17:40 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 15:17:40 +0200 Subject: [Celerity-users] wait / js_eval Message-ID: Hi Groopies, I had a monkey patch in firewatir that made sure that the browser finished with any ajax before it gave control back to the calling code. Now, I notice that the celerity wait falls apart when ajax is involved (which is more often than not - otherwise we would not be using it I guess). I dont think it is acceptable to have to "guess wait times" with sleep(x) and hope that something is loaded or not - that is really shakey. Of course, if you know what elements to expect on the page then you can obviously keep checking the page untill they exist - but unfortunately, I don't have that luxury. This is what my monkey patch looked like - Is there anyway to get this into celerity?? def wait(last_url = nil) isLoadingDocument = "" start = Time.now while isLoadingDocument != "0" isLoadingDocument = js_eval("#{BROWSER_VAR}=#{WINDOW_VAR}.getBrowser(); sleep(0.25) # this was just to repeat fire over tcp if (Time.now - start) > 300 raise "Page Load Timeout" end end end As js_eval no longer exists and I guess there is no such things "WINDOW_VAR" and "BROWSER_VAR" etc (and I dont know much about java/ script)I do not really know how to patch something similar. Any advise? Thanks a million Jason. From jari.bakken at gmail.com Tue Aug 11 11:07:22 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 11 Aug 2009 17:07:22 +0200 Subject: [Celerity-users] wait / js_eval In-Reply-To: References: Message-ID: On Tue, Aug 11, 2009 at 3:17 PM, jason franklin-stokes wrote: > > This is what my monkey patch looked like - Is there anyway to get this into > celerity?? > Please take a look at the Ajax page on the wiki http://wiki.github.com/jarib/celerity/ajax Celerity has Browser#execute_script if you need to evaluate any JavaScript code (as does FireWatir and Watir now, btw). From jasoninclass at googlemail.com Tue Aug 11 11:28:07 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 17:28:07 +0200 Subject: [Celerity-users] wait / js_eval In-Reply-To: References: Message-ID: <50581814-1B23-4008-988A-E629819105C3@googlemail.com> Jari Yep - I am so sorry!!! I have found and done as instructed there. !! Works fine. Jason On Aug 11, 2009, at 5:07 PM, Jari Bakken wrote: > On Tue, Aug 11, 2009 at 3:17 PM, jason > franklin-stokes wrote: >> >> This is what my monkey patch looked like - Is there anyway to get >> this into >> celerity?? >> > > Please take a look at the Ajax page on the wiki > > http://wiki.github.com/jarib/celerity/ajax > > Celerity has Browser#execute_script if you need to evaluate any > JavaScript code (as does FireWatir and Watir now, btw). > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Tue Aug 11 11:31:26 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 17:31:26 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> References: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> Message-ID: Ashley, I was a bit quick to jump the gun. It seems that there is some issue with page caching to disk. page object marshalling to disk and then marsahling loading back works as far as you do not look for elements. Here the example: =============== START CODE require "rubygems" require "celerity" browser = Celerity::Browser.new :browser => :firefox, :log_level => :off browser.clear_cookies browser.goto("http://www.google.com") browser.resynchronized do browser.link(:text, "News").click end File.open("#{Dir.pwd}/google.dmp", 'w') {|f| f.write(Marshal.dump(browser.page)) } page_dumped = browser.page File.open("#{Dir.pwd}/google.dmp", 'r') {|f| browser.page = Marshal.load(f) } page_loaded = browser.page # # This works fine - obviously # browser.page = page_dumped puts browser.page.inspect puts browser.url puts browser.links # # This causes a warning: celerity caught java.lang.NullPointerException: null - retry #1 # no links are ever found it regresses into a endless loop # browser.page = page_loaded puts browser.page.inspect puts browser.url # result is http://www.yahoo.com puts browser.links ============= END CODE Any Ideas? Jason. On Aug 10, 2009, at 11:04 PM, Ashley Moran wrote: > > On 10 Aug 2009, at 21:41, jason franklin-stokes wrote: > >> I am trying to figure out if it is possible to cache (save) a page >> and load it back into the "browser" and continue using it later (ie >> clicking of links and buttons) without having to issue a >> browser.goto(url). > > Hi Jason > > I don't believe this is currently possible, but I've filed an > HtmlUnit ticket for it if you want to comment on it: > > http://sourceforge.net/tracker/index.php?func=detail&aid=2831644&group_id=47038&atid=448269 > > Cheers > Ashley > > -- > http://www.patchspace.co.uk/ > http://www.linkedin.com/in/ashleymoran > http://aviewfromafar.net/ > > > > > > > > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jari.bakken at gmail.com Tue Aug 11 12:22:08 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 11 Aug 2009 18:22:08 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> Message-ID: Out of curiousity, what's the use case? I can see Ashley's point about the back button loading a cached version, but why do you want to store the objects on disk? From jasoninclass at googlemail.com Tue Aug 11 13:05:52 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 19:05:52 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> Message-ID: <7E145F92-C5DA-42E0-8C09-472AAF59133C@googlemail.com> Jari, The use case is "autonomous global website testing:" The idea is that a website as a whole should be tested automatically and independently from the changing structure (development and redesign stages). Meaning exceptions can be formulated globally over the entire website and the tests do not have to be rewritten when the design or structure changes. example: "assert all pages have a menu" menu means just means an element that contains links that will appear on every page of the websites. It is then irrelevant if they are text links, image maps or a form. The assertion machine just has to work out if an element looks like a menu. example: "assert that page has a login" This again means that something has to look at the page and work out if it has a login - regardless how often the page design changes how the login is programatically solved. example: "assert that a form on this page renders a list of items" Is the same sort of idea. The machinery that asserts the assertions has a great deal of information to analyze in the shortest possible time - and this has a high cost on the server - and is actually almost impossible in post form summit cases because it would have to go back and repost the form in order to continue down and expand each leaf of the the site tree. Hope the test case makes sense. Best Jason. On Aug 11, 2009, at 6:22 PM, Jari Bakken wrote: > Out of curiousity, what's the use case? I can see Ashley's point about > the back button loading a cached version, but why do you want to store > the objects on disk? > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Tue Aug 11 17:23:26 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Tue, 11 Aug 2009 23:23:26 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> Message-ID: browser.page is actually a wrapper for Java::ComGargoylesoftwareHtmlunitHtml::HtmlPage which is a java object. All the browser.page does is effectively return the a pointer to the java object - so marshal dump will only dump the page instance variable - not the java class object. Does anyone know it there are any library methods in htmlunit that will save and reload a page to and from disk? Thanks a million for any pointers Jason. On Aug 11, 2009, at 6:22 PM, Jari Bakken wrote: > Out of curiousity, what's the use case? I can see Ashley's point about > the back button loading a cached version, but why do you want to store > the objects on disk? > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Wed Aug 12 01:10:41 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Wed, 12 Aug 2009 07:10:41 +0200 Subject: [Celerity-users] page cacheing In-Reply-To: References: <7C2A8B80-6765-4EE7-8845-4A7BE61153A5@patchspace.co.uk> Message-ID: <9E47D382-5FE9-4427-829D-54CC1FDD8A71@googlemail.com> Hi Groupies, Just to let you know, page caching is out of order. htmlunit does have a serializer for htmlpage - but it does not work properly. And looking at the java code implies that styles, hidden inputs and scripts are just not being serialized. The fix at htmlunit is on prio 5, so I guess this will take forever to fix - which pretty much blows by use case. On Aug 11, 2009, at 6:22 PM, Jari Bakken wrote: > Out of curiousity, what's the use case? I can see Ashley's point about > the back button loading a cached version, but why do you want to store > the objects on disk? > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From caius at brightbox.co.uk Thu Aug 13 05:40:22 2009 From: caius at brightbox.co.uk (Caius Durling) Date: Thu, 13 Aug 2009 10:40:22 +0100 Subject: [Celerity-users] input type=image Message-ID: <9F498EF0-D97B-468F-B15D-4540A5C783EE@brightbox.co.uk> Hi all, I've got an that I'm trying to click using celerity, which I *think* should be a text_field(:class, "foo") from poking through the source and looking at the list of supported elements[1], but I don't appear to be able to select it. Anyone know if this is possible to do? Or any pointers on how to add a class for a new element if I need to? [1]: http://wiki.github.com/jarib/celerity/list-of-supported-elements C --- Caius Durling Brightbox caius at brightbox.co.uk http://brightbox.co.uk/ From caius at brightbox.co.uk Thu Aug 13 11:54:50 2009 From: caius at brightbox.co.uk (Caius Durling) Date: Thu, 13 Aug 2009 16:54:50 +0100 Subject: [Celerity-users] input type=image In-Reply-To: References: <9F498EF0-D97B-468F-B15D-4540A5C783EE@brightbox.co.uk> <4FD255D5-D969-4F6A-B265-A592EFE500D0@brightbox.co.uk> Message-ID: On 13 Aug 2009, at 11:30, jason franklin-stokes wrote: > browser.image(:index, x).click > or > browser.button(:index.y).click > > work aswell? Just tried it on a test html form: http://gist.github.com/167254 As you can see, button() works fine, image() returns a not found exception. Makes sense really I guess. I added to the list of supported elements under the button method, hopefully helps someone figure it out faster than me in the future :) C --- Caius Durling Brightbox caius at brightbox.co.uk http://brightbox.co.uk/ From jasoninclass at googlemail.com Thu Aug 13 12:05:47 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Thu, 13 Aug 2009 18:05:47 +0200 Subject: [Celerity-users] input type=image In-Reply-To: References: <9F498EF0-D97B-468F-B15D-4540A5C783EE@brightbox.co.uk> <4FD255D5-D969-4F6A-B265-A592EFE500D0@brightbox.co.uk> Message-ID: Caius, Thanks a million for checking that!! Jason. On Aug 13, 2009, at 5:54 PM, Caius Durling wrote: > On 13 Aug 2009, at 11:30, jason franklin-stokes wrote: > >> browser.image(:index, x).click >> or >> browser.button(:index.y).click >> >> work aswell? > > > Just tried it on a test html form: > > http://gist.github.com/167254 > > As you can see, button() works fine, image() returns a not found > exception. Makes sense really I guess. > > I added to the list of supported elements under > the button method, hopefully helps someone figure it out faster than > me in the future :) > > C > --- > Caius Durling > Brightbox > caius at brightbox.co.uk > http://brightbox.co.uk/ > > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Thu Aug 13 16:53:00 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Thu, 13 Aug 2009 22:53:00 +0200 Subject: [Celerity-users] tests? where are they? Message-ID: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> Hi Groupies, I am trying to find the unit test for celerity? I installed the gem, but I cannot seem to find any tests. any ideas? Thanks a million Jason. From jari.bakken at gmail.com Thu Aug 13 17:14:56 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Thu, 13 Aug 2009 23:14:56 +0200 Subject: [Celerity-users] onchange oddness In-Reply-To: <42e993830908131320p7fe4521asc7c5808bcef72d73@mail.gmail.com> References: <42e993830908131320p7fe4521asc7c5808bcef72d73@mail.gmail.com> Message-ID: On Thu, Aug 13, 2009 at 10:20 PM, Erik Ostrom wrote: > Instead of updating a second field, I can just focus on a new element, and I > get a second change event with the correct field values. This is arguably > appropriate - since the change event shouldn't be fired until the user tabs > away from the changed field - but then why is the first event being fired? > That sounds weird. You should create a small HTML example that will reproduce the issue and submit it to HtmlUnit's mailing list [1] (or tracker [2]), as they are the ones that have the ability to change this behaviour. [1] https://lists.sourceforge.net/lists/listinfo/htmlunit-user [2] http://sourceforge.net/tracker/?group_id=47038&atid=448266 From jari.bakken at gmail.com Thu Aug 13 17:18:04 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Thu, 13 Aug 2009 23:18:04 +0200 Subject: [Celerity-users] tests? where are they? In-Reply-To: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> References: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> Message-ID: On Thu, Aug 13, 2009 at 10:53 PM, jason franklin-stokes wrote: > Hi Groupies, > > I am trying to find the unit test for celerity? > I installed the gem, but I cannot seem to find any tests. > > any ideas? > The tests are not included in the gem. You need to check out the code from GitHub [1] and run `rake watispec:init`. Then look in the spec/ and spec/watirspec folders. (The bulk of the test suite was recently moved to a separate project [2]). Specs can be run with `jruby -S rake spec`. [1] http://github.com/jarib/celerity/tree/master [2] http://github.com/jarib/watirspec/tree/master From jasoninclass at googlemail.com Thu Aug 13 18:03:38 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Fri, 14 Aug 2009 00:03:38 +0200 Subject: [Celerity-users] tests? where are they? In-Reply-To: References: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> Message-ID: <9C9DB752-0463-4E00-A6EA-9081DCBEA44F@googlemail.com> hi jari, i dont seem to be able to get it running. after cloning the git reposi and cd to celerity, i running this: rake watispec:init results in following output: rake aborted! no such file to load -- hoe Rakefile:4 rake -T causes exactly same output very very strange. the hoe.rb in the config folder requires 'celerity/version' but there in no celerity folder in config or the level above that ?? I am a little confused - any advice? Jason On Aug 13, 2009, at 11:18 PM, Jari Bakken wrote: > On Thu, Aug 13, 2009 at 10:53 PM, jason > franklin-stokes wrote: >> Hi Groupies, >> >> I am trying to find the unit test for celerity? >> I installed the gem, but I cannot seem to find any tests. >> >> any ideas? >> > > The tests are not included in the gem. You need to check out the code > from GitHub [1] and run `rake watispec:init`. > Then look in the spec/ and spec/watirspec folders. (The bulk of the > test suite was recently moved to a separate project [2]). Specs can be > run with `jruby -S rake spec`. > > > [1] http://github.com/jarib/celerity/tree/master > [2] http://github.com/jarib/watirspec/tree/master > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jari.bakken at gmail.com Thu Aug 13 18:16:51 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 14 Aug 2009 00:16:51 +0200 Subject: [Celerity-users] tests? where are they? In-Reply-To: <9C9DB752-0463-4E00-A6EA-9081DCBEA44F@googlemail.com> References: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> <9C9DB752-0463-4E00-A6EA-9081DCBEA44F@googlemail.com> Message-ID: You need to install the 'hoe' gem. From jasoninclass at googlemail.com Fri Aug 14 03:47:00 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Fri, 14 Aug 2009 09:47:00 +0200 Subject: [Celerity-users] tests? where are they? In-Reply-To: References: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> Message-ID: <13139589-A42B-4F76-B6A2-C40B5004A9AC@googlemail.com> hmmm, ok - cloned the current head from the repository ran jruby -S gem build ran jruby -S rake -T (it complained about the README.txt missing - so I gave the file from the current release) ran jruby -S rake -T ok ran jruby -S rake watirspec:init ok ran jruby -S rake spec then it blew up with /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rspec-1.2.8/lib/spec/rake/ spectask.rb:177:in `define' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 1112:in `verbose' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rspec-1.2.8/lib/spec/rake/ spectask.rb:153:in `define' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 636:in `call' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 636:in `execute' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 631:in `each' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 631:in `execute' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 597:in `invoke_with_call_chain' /Library/jruby-1.3.0/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 590:in `invoke_with_call_chain' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 583:in `invoke' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2051:in `invoke_task' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2029:in `top_level' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2029:in `each' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2029:in `top_level' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2068:in `standard_exception_handling' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2023:in `top_level' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2001:in `run' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 2068:in `standard_exception_handling' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb: 1998:in `run' /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:19:in `load' /Library/jruby-1.3.0/bin/rake:19 any ideas? thanks a million Jason On Aug 13, 2009, at 11:18 PM, Jari Bakken wrote: > On Thu, Aug 13, 2009 at 10:53 PM, jason > franklin-stokes wrote: >> Hi Groupies, >> >> I am trying to find the unit test for celerity? >> I installed the gem, but I cannot seem to find any tests. >> >> any ideas? >> > > The tests are not included in the gem. You need to check out the code > from GitHub [1] and run `rake watispec:init`. > Then look in the spec/ and spec/watirspec folders. (The bulk of the > test suite was recently moved to a separate project [2]). Specs can be > run with `jruby -S rake spec`. > > > [1] http://github.com/jarib/celerity/tree/master > [2] http://github.com/jarib/watirspec/tree/master > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jari.bakken at gmail.com Fri Aug 14 07:12:24 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 14 Aug 2009 13:12:24 +0200 Subject: [Celerity-users] tests? where are they? In-Reply-To: <13139589-A42B-4F76-B6A2-C40B5004A9AC@googlemail.com> References: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> <13139589-A42B-4F76-B6A2-C40B5004A9AC@googlemail.com> Message-ID: On Fri, Aug 14, 2009 at 9:47 AM, jason franklin-stokes wrote: > then it blew up with > > /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rspec-1.2.8/lib/spec/rake/spectask.rb:177:in > `define' That stack trace is just Rake - it doesn't point to the real problem. Try `jruby -S spec spec/**/*_spec.rb` From jasoninclass at googlemail.com Fri Aug 14 07:48:54 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Fri, 14 Aug 2009 13:48:54 +0200 Subject: [Celerity-users] tests? where are they? In-Reply-To: References: <36FC65D6-ABA6-4977-94B4-5822EDD89B7F@googlemail.com> <13139589-A42B-4F76-B6A2-C40B5004A9AC@googlemail.com> Message-ID: ok - great - works after installing the sinatra gem On Aug 14, 2009, at 1:12 PM, Jari Bakken wrote: > On Fri, Aug 14, 2009 at 9:47 AM, jason > franklin-stokes wrote: >> then it blew up with >> >> /Library/jruby-1.3.0/lib/ruby/gems/1.8/gems/rspec-1.2.8/lib/spec/ >> rake/spectask.rb:177:in >> `define' > > That stack trace is just Rake - it doesn't point to the real problem. > > Try `jruby -S spec spec/**/*_spec.rb` > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From ashley.moran at patchspace.co.uk Fri Aug 14 10:02:03 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Fri, 14 Aug 2009 15:02:03 +0100 Subject: [Celerity-users] Silencing a specific SEVERE warning from Dojo In-Reply-To: References: <93BD5484-EBEF-48D8-9FD4-08A4D2EB1896@patchspace.co.uk> Message-ID: On Jul 19, 2009, at 12:28 pm, Jari Bakken wrote: > You should definitely post this to the HtmlUnit list. Hopefully > HtmlUnit can become "sane". Hi Jari This ticket has been updated. Do you know what version Celerity is using relative to HtmlUnit trunk? http://sourceforge.net/tracker/?func=detail&atid=448266&aid=2823863&group_id=47038 Cheers Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ http://twitter.com/ashleymoran From jari.bakken at gmail.com Fri Aug 14 13:48:52 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 14 Aug 2009 19:48:52 +0200 Subject: [Celerity-users] Silencing a specific SEVERE warning from Dojo In-Reply-To: References: <93BD5484-EBEF-48D8-9FD4-08A4D2EB1896@patchspace.co.uk> Message-ID: On Fri, Aug 14, 2009 at 4:02 PM, Ashley Moran wrote: > This ticket has been updated. ?Do you know what version Celerity is using > relative to HtmlUnit trunk? > Still seeing the exception with the latest snapshot from here (I tried it seconds ago): http://build.canoo.com/htmlunit/artifacts/ If that's not the same as SVN trunk, they should create a new snapshot, and I'll update Celerity in seconds ;) From jari.bakken at gmail.com Mon Aug 17 05:11:30 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 17 Aug 2009 11:11:30 +0200 Subject: [Celerity-users] New cross-platform viewers Message-ID: Hello, I've written a Celerity Viewer in Qt, which means people on both OS X, Windows and Linux should be able to watch their pages rendered in WebKit view, use the WebKit inspector etc. Read more about how the viewers work on the wiki [1], or how to install in the readme [2]. [1] http://wiki.github.com/jarib/celerity/viewers [2] http://github.com/jarib/celerity-viewers/blob/master/qt/README.markdown From jari.bakken at gmail.com Tue Aug 18 11:37:11 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 18 Aug 2009 17:37:11 +0200 Subject: [Celerity-users] dumping dom In-Reply-To: <728b34420908180013o28d9f668la87797ceb4ff1b4b@mail.gmail.com> References: <728b34420908180013o28d9f668la87797ceb4ff1b4b@mail.gmail.com> Message-ID: Hello, On Tue, Aug 18, 2009 at 9:13 AM, Andreas Andersson wrote: > Hi! > > I have two questions. > > 1) Is it possible to dump the dom-model (current source) or even the > original source? You can get the current DOM with Browser#xml and the original source with Browser#html. > 2) How can I add ssl-certificatats? Currently I just turned :secure_ssl => > false but it doesn't feel "right". > HtmlUnit doesn't have an API to whitelist specific certificates, so Celerity doesn't either - it's all or nothing at the moment. You should ask on the HtmlUnit list: https://lists.sourceforge.net/lists/listinfo/htmlunit-user From ashley.moran at patchspace.co.uk Tue Aug 18 12:47:05 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Tue, 18 Aug 2009 17:47:05 +0100 Subject: [Celerity-users] dumping dom In-Reply-To: References: <728b34420908180013o28d9f668la87797ceb4ff1b4b@mail.gmail.com> Message-ID: <0C3A8002-FD02-48F9-B693-504CA0E44341@patchspace.co.uk> On 18 Aug 2009, at 16:37, Jari Bakken wrote: > You can get the current DOM with Browser#xml and the original source > with Browser#html. I've always found it impossible to remember which way round these are. Aliases might help, such as Browser#original_html and Browser#generated_html. WDYT? Worth filing a ticket? Cheers Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ From caius at brightbox.co.uk Tue Aug 18 13:18:24 2009 From: caius at brightbox.co.uk (Caius Durling) Date: Tue, 18 Aug 2009 18:18:24 +0100 Subject: [Celerity-users] dumping dom In-Reply-To: <0C3A8002-FD02-48F9-B693-504CA0E44341@patchspace.co.uk> References: <728b34420908180013o28d9f668la87797ceb4ff1b4b@mail.gmail.com> <0C3A8002-FD02-48F9-B693-504CA0E44341@patchspace.co.uk> Message-ID: <691872DD-7101-430B-984B-7D4A22FC23CC@brightbox.co.uk> On 18 Aug 2009, at 17:47, Ashley Moran wrote: > On 18 Aug 2009, at 16:37, Jari Bakken wrote: > >> You can get the current DOM with Browser#xml and the original source >> with Browser#html. > > I've always found it impossible to remember which way round these > are. Aliases might help, such as Browser#original_html and > Browser#generated_html. WDYT? Worth filing a ticket? I didn't know these returned different things until I saw Jari's email (having only skim-read the list of methods in the documentation, rather than reading what each method does specifically.) I think having alias' for them which are named more appropriately would be brilliant. C --- Caius Durling Brightbox caius at brightbox.co.uk http://brightbox.co.uk/ From jari.bakken at gmail.com Tue Aug 18 13:38:14 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 18 Aug 2009 19:38:14 +0200 Subject: [Celerity-users] dumping dom In-Reply-To: <691872DD-7101-430B-984B-7D4A22FC23CC@brightbox.co.uk> References: <728b34420908180013o28d9f668la87797ceb4ff1b4b@mail.gmail.com> <0C3A8002-FD02-48F9-B693-504CA0E44341@patchspace.co.uk> <691872DD-7101-430B-984B-7D4A22FC23CC@brightbox.co.uk> Message-ID: On Tue, Aug 18, 2009 at 7:18 PM, Caius Durling wrote: > I think having alias' for them which are named more appropriately would be > brilliant. > Sure thing! Are those good names? How about Browser#source and Browser#dom? From ashley.moran at patchspace.co.uk Tue Aug 18 19:15:08 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Wed, 19 Aug 2009 00:15:08 +0100 Subject: [Celerity-users] dumping dom In-Reply-To: References: <728b34420908180013o28d9f668la87797ceb4ff1b4b@mail.gmail.com> <0C3A8002-FD02-48F9-B693-504CA0E44341@patchspace.co.uk> <691872DD-7101-430B-984B-7D4A22FC23CC@brightbox.co.uk> Message-ID: <452E67FD-D64D-4D6F-A3F6-FAC105601A46@patchspace.co.uk> On 18 Aug 2009, at 18:38, Jari Bakken wrote: > Sure thing! Are those good names? How about Browser#source and > Browser#dom? Neither of those leaps out to me as being obviously the original or generated state. Browser#original_source and Browser#dom would be closer. But "dom" suggests an object graph, at least to me. Just my 0.02 units of currency. Any thoughts? Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ From ben at benmabey.com Mon Aug 24 02:42:48 2009 From: ben at benmabey.com (Ben Mabey) Date: Mon, 24 Aug 2009 00:42:48 -0600 Subject: [Celerity-users] Checking to see if div has been updated by a periodic poller Message-ID: <4A923668.2030405@benmabey.com> Hi all, I have a div element which is periodically updated via AJAX polling. The polling is not triggered by the user but starts once the page loads. I couldn't figure out what would be the ideal way to do this. What I ended up doing was to have my JS mark the div once it had been updated (via a rel tag). My browser waits until is the rel indicates that the the div had been updated... Here is the JS: jQuery(document).ready(function () { jQuery('#slide-container').ekko({ url : '/slides/#{@slide.number}/update', minTimeout : 500, }, function (data) { $('#slide-container').empty().append(data).attr('rel', 'updated'); }); }); And the corresponding celerity code I'm using: browser.wait_until { browser.div(:id, 'slide-container').attribute_string =~ /rel="([^"]*)"/ && $1 == 'updated' } (BTW, if there is a better way of getting the rel attribute- please let me know.) The above works fine but I'm wondering if I am making things too complicated. Does anyone have any better ideas on how to test this? Any suggestions would be appreciated. Thanks, Ben From jari.bakken at gmail.com Mon Aug 24 06:10:03 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 24 Aug 2009 12:10:03 +0200 Subject: [Celerity-users] Checking to see if div has been updated by a periodic poller In-Reply-To: <4A923668.2030405@benmabey.com> References: <4A923668.2030405@benmabey.com> Message-ID: On Mon, Aug 24, 2009 at 8:42 AM, Ben Mabey wrote: > Hi all, > I have a div element which is periodically updated via AJAX polling. ?The > polling is not triggered by the user but starts once the page loads. ?I > couldn't figure out what would be the ideal way to do this. ?What I ended up > doing was to have my JS mark the div once it had been updated (via a rel > tag). My browser waits until is the rel indicates that the the div had been > updated... > My approach is usually to ask myself "how would I check for this if I test it manually", and if I can't make Celerity do that (which is rare but happens), I'd use an approach like this. Your solution seems fine to me. > > browser.wait_until { browser.div(:id, 'slide-container').attribute_string =~ > /rel="([^"]*)"/ && $1 == 'updated' } > > > (BTW, if there is a better way of getting the rel attribute- please let me > know.) > Celerity loosely follows the HTML 4 spec - if you want to get invalid attributes you can use Element#attribute_value, so: browser.div(:id, 'slide-container').attribute_value("rel") From ben at benmabey.com Mon Aug 24 09:39:23 2009 From: ben at benmabey.com (Ben Mabey) Date: Mon, 24 Aug 2009 07:39:23 -0600 Subject: [Celerity-users] Checking to see if div has been updated by a periodic poller In-Reply-To: References: <4A923668.2030405@benmabey.com> Message-ID: <4A92980B.3060503@benmabey.com> Jari Bakken wrote: > On Mon, Aug 24, 2009 at 8:42 AM, Ben Mabey wrote: > >> Hi all, >> I have a div element which is periodically updated via AJAX polling. The >> polling is not triggered by the user but starts once the page loads. I >> couldn't figure out what would be the ideal way to do this. What I ended up >> doing was to have my JS mark the div once it had been updated (via a rel >> tag). My browser waits until is the rel indicates that the the div had been >> updated... >> >> > > My approach is usually to ask myself "how would I check for this if I > test it manually", and if I can't make Celerity do that (which is rare > but happens), I'd use an approach like this. Your solution seems fine > to me. > > I suppose I could wait until the page contains the expected text that it should be updated to. The reason why I didn't do that was because I was trying to create a reusable Cucumber step definition. However, the feature might read better if I move the waiting into the actual step anyways... Hmm.. >> browser.wait_until { browser.div(:id, 'slide-container').attribute_string =~ >> /rel="([^"]*)"/ && $1 == 'updated' } >> >> >> (BTW, if there is a better way of getting the rel attribute- please let me >> know.) >> >> > > Celerity loosely follows the HTML 4 spec - if you want to get invalid > attributes you can use Element#attribute_value, so: > > browser.div(:id, 'slide-container').attribute_value("rel") > Great, thanks! -Ben From jari.bakken at gmail.com Mon Aug 24 16:44:48 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 24 Aug 2009 22:44:48 +0200 Subject: [Celerity-users] Inner_html In-Reply-To: <786ddd160908241051x4fe2f1b1lfa7dbf864f175dc3@mail.gmail.com> References: <786ddd160908241051x4fe2f1b1lfa7dbf864f175dc3@mail.gmail.com> Message-ID: On Mon, Aug 24, 2009 at 7:51 PM, chao Lam wrote: > Is there a way to get the inner_html of an Element, as you can in Watir? > I can't see any Element#inner_html in Watir - where do you see that? HtmlUnit doesn't implement this method on its HtmlElement class, but you can get to it through the JS object: browser.div(:id, 'foo').javascript_object.innerHTML From jari.bakken at gmail.com Mon Aug 24 17:18:25 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 24 Aug 2009 23:18:25 +0200 Subject: [Celerity-users] Inner_html In-Reply-To: <786ddd160908241407n4638dca6re84f250cb40bc76f@mail.gmail.com> References: <786ddd160908241051x4fe2f1b1lfa7dbf864f175dc3@mail.gmail.com> <786ddd160908241407n4638dca6re84f250cb40bc76f@mail.gmail.com> Message-ID: On Mon, Aug 24, 2009 at 11:07 PM, chao Lam wrote: > You're right, it doesn't seem like an official api. But if you query a watir > element with the mothod "inner_html" or "innerHTML", it does return the > right result. Both raise a NoMethodError for me: http://gist.github.com/174197. Perhaps you're accessing the Win32OLE object directly, that might respond to those methods. And that's roughly equivalent to accessing Celerity's Element#javascript_object. From jari.bakken at gmail.com Thu Aug 27 02:46:01 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Thu, 27 Aug 2009 08:46:01 +0200 Subject: [Celerity-users] cells enumeration not working ? In-Reply-To: <3a8841390908261536q635e656dr732da13f0c85f07c@mail.gmail.com> References: <3a8841390908261536q635e656dr732da13f0c85f07c@mail.gmail.com> Message-ID: <7234CE51-8764-4447-A492-B69DEB1CE308@gmail.com> Den 27. aug. 2009 kl. 00.36 skrev doridori Jo : > i am trying to get all > > so i did > > a = browser.cells.select { |e| e.class =~ /something/ } > a.each do |b| > b.text > end > Try printing the value of e.class and you will see why it's not working. You want Element#class_name. > however nothing is returned. when i just do browser.cells, > everything is returned, however i want to filter....the class exists > 100%. > > > > > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From jasoninclass at googlemail.com Fri Aug 28 06:01:19 2009 From: jasoninclass at googlemail.com (jason franklin-stokes) Date: Fri, 28 Aug 2009 12:01:19 +0200 Subject: [Celerity-users] java hrefs Message-ID: <24D309C4-EA08-420B-A028-E9D1DB763E2D@googlemail.com> Dear Groupies, I often have the case where links hrefs encoded by javascripts (i.e. hello) I can obviously find out what the real href is by clicking the object and reading the url from the browser object. Is there anyway of finding out what the href is without actually sending the browser to the destination? Any ideas would be great Thanks a million Jason.