
| Key: |
WTR-166
|
| Type: |
New Feature
|
| Status: |
Open
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Jeff Fry
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
Watir
Created: 21/Jun/07 04:30 PM
Updated: 14/Oct/07 11:00 AM
|
|
| Component/s: |
None
|
| Affects Version/s: |
1.5.0/1.5.1
|
| Fix Version/s: |
Future
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
|
Watir.wait() listens to whether IE thinks its done loading, and then checks to see that the main document and any sub documents/frames have finished loading. More and more, there are pages that on load also kick off various XHRs and timers. For me - and possibly for a growing number of folks, testing more AJAXy applications - it would be great to expand wait() to check if there are any XHRs or timers pending, in additional to the checks it currently makes.
Note, I don't know, but there may be applications where an XHR is intentionally left open at all times. If this happens I would guess that it's rare, but if we change the default behavior of watir.wait() to wait for pending XHRs and timers, we might want to give a config option that turns this off as well.
|
|
Description
|
Watir.wait() listens to whether IE thinks its done loading, and then checks to see that the main document and any sub documents/frames have finished loading. More and more, there are pages that on load also kick off various XHRs and timers. For me - and possibly for a growing number of folks, testing more AJAXy applications - it would be great to expand wait() to check if there are any XHRs or timers pending, in additional to the checks it currently makes.
Note, I don't know, but there may be applications where an XHR is intentionally left open at all times. If this happens I would guess that it's rare, but if we change the default behavior of watir.wait() to wait for pending XHRs and timers, we might want to give a config option that turns this off as well. |
Show » |
|
require 'test/unit'
require 'watir'
class TC_one_topic < Test::Unit::TestCase
# Load one page. Test if wait() waits for XHRs and Timers.
def test_xhr_loaded
@urlRoot = 'http://sandbox.freebase.com' # test server
@ie = Watir::IE.new
@ie.set_fast_speed
@ie.goto(@urlRoot+'/view/kevin_bacon') #Kevin Bacon
#enabling this makes the test pass.
#while !@ie.link(:text,'United States').exists?
# sleep 1
#end
assert(@ie.link(:text,'United States').exists?)
end #test_xhr_loaded
end #class