From: Fan Jin Date: 2010-12-23T15:11:00+09:00 Subject: Re: how to know a search result is successfully displayed through its source codes Gordon Thiesfeld wrote in post #970057: > On Tue, Dec 21, 2010 at 8:02 PM, Fan Jin wrote: >> Jeremy Bopp wrote in post #969808: >> >> Yes, the library I am using here is watir, but the two times which I >> caught from click and result return are properly not right, they are >> identical even the interface's response time is longer than 2s. >> The method I used here was ping the HTTP server, once the result was >> returned, the happened time was caught. >> Need your more help, thanks :> >> > > If you post some code, folks might be better able to help you. The codes I wrote was following: #set a key word in search field, then click the search button. browser.text_field(:id, 'simpleSearchInput').set('test') browser.link(:id,'simpleSearchSubmit').click t1 = Time.now # get the time when button is clicked. Watir::Wait.until{browser.div(:id, 'srpWrapper').exists?}#wait until the search result list is loaded, here I used div(:id) to ensure that result is finish loading. t2 = Time.now # give the time t2. t = t2 - t1 # This is the system responding time. puts "the system response time is: " + t.to_s Although the codes run well, the time it returns is almost the same. I think there is a method in watir which can get the time of response directly after a new webpage was loaded. Need folks help.Thanks Jin Fan -- Posted via http://www.ruby-forum.com/.