Question

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 FireWATIR 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?

Was it helpful?

Solution

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")

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top