Hi Navi, I don't think you'll be able to directly call Page-Object's #wait_for_ajax from an after hook. You'll have to do the wait directly.
I believe you said you were using jQuery. Where you are initializing the browser, add the following line to add the after_hook: browser = Watir::Browser.new browser.after_hooks.add do |browser| browser.wait_until { browser.execute_script('return jQuery.active;') == 0 } end Justin On Tuesday, September 11, 2018 at 12:56:11 AM UTC-4, NaviHan wrote: > > We did discuss this previously. Im trying to find a way to use > wait_for_ajax for each and every element. > > Titus or Justin has earlier suggested to move this to the hooks.rb file. > > Could you guys tell me how to use it in hooks? > > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.