Like Z I think I'm perplexed here as to exactly what it is you are wanting to do.
If the problem is elements not found on the page, and it works 'manually' from an IRB prompt, but not when you run the script, you might need to insert a few sleep statements here and there in your code to allow for client side code on the page to render things. That' common with pages with lots of javascript or sometimes heavy CSS formatting. Unfortunately unless your page code specifically provides some way to know when it is busy manipulating stuff, vs when it is done, there is really no way for Watir to when the clientside operations are done. An example of what I mean by that is what the site I'm testing does, it has a little animated 'loading' graphic it displays when its doing things like updating the page via jquery, or running any client side scripts. This 'icon' resides in a div, and the system sets it visible while clent side code is running, and then hides it again once it's done. It's there for the users really, so they will know something is going on, but that doesn't mean I can't use it also. So what I'm able to do in my automation is have a method I call that looks like this def sleepWhileLoading while browser.div(:id, 'masterprogress').visible? sleep 1 end end in my scripts, anyplace that i might need to wait for the jquery stuff to update the page, or any other client side scripting to finish, I just call that method. If that's not your problem then.. 'An example would be handy right about now' On Feb 24, 5:24 am, Željko Filipin <[email protected]> wrote: > On Thu, Feb 24, 2011 at 1:49 PM, Ashu <[email protected]> wrote: > > Its working fine for me with HTML page > > But there is a problem inspecting the page of your PHP app? > > Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
