WATIR/ FireWATIR URL consistency?
We are at the start of a project to test a new web application written in jQuery and are planning to do it using WATIR and FireWATIR.
During the proof of concepts test I've discovered differences in how WATIR and FireWATIR represent URLs, for example a script which passes in Fi开发者_高级运维reWATIR generates this error in WATIR.
assert_equal(expandImage.src,"../WebToolKit/images/closed.jpg")
testBrowserGadget2(WebClientHomePage) [002_pub_browser.rb:108]:
<"http://172.24.4.125:8081/WebToolKit/images/closed.jpg"> expected but was
<"../WebToolKit/images/closed.jpg">.
Is there any setting in either WATIR or FireWATIR I can enable so that the URL value is consistent between when running against IE and Firefox?
I use the uri module ...
e.g. require 'uri'
URI.parse("http://google.com/image/path.jpg").path => "/image/path.jpg"
i.e. assert_equal(URI.parse(expandImage.src).path,"../WebToolKit/images/closed.jpg")
you could use assert_match http://en.wikibooks.org/wiki/Ruby_Programming/Unit_testing
精彩评论