R
reed.adam
All,
The most important part of the site I need to test is content. I need
to make sure that specific links exist, and direct to the correct pages
(this is all dynamic content set in a form by a user).
Being new to Watir and having done the scripting 101 test and viewing
examples, one method to test would be the following. Of course, it's
just looking for text not links, but the general purpose is the same:
if ie.contains_text("Home")
puts "Test Passed. Found the test string: 'Home'."
else
puts "Test Failed! Could not find: 'Home'"
end
if ie.contains_text("This Link")
puts "Test Passed. Found the test string: 'This Link'."
else
puts "Test Failed! Could not find: 'This Link'"
end
etc,etc,etc,etc,etc!!!!!
That's 5 lines per link -- there has to be a better way! I researched
the assert commands and such, but there isn't much documentation on how
to use them.
How would a more experienced Watir/Ruby programmer address this issue?
I will be verifying links like this, specific images, body text. . .
believe it or not, the automated functions like logging in and moving
around seem much easier to me!
Thanks in advance,
Adam
The most important part of the site I need to test is content. I need
to make sure that specific links exist, and direct to the correct pages
(this is all dynamic content set in a form by a user).
Being new to Watir and having done the scripting 101 test and viewing
examples, one method to test would be the following. Of course, it's
just looking for text not links, but the general purpose is the same:
if ie.contains_text("Home")
puts "Test Passed. Found the test string: 'Home'."
else
puts "Test Failed! Could not find: 'Home'"
end
if ie.contains_text("This Link")
puts "Test Passed. Found the test string: 'This Link'."
else
puts "Test Failed! Could not find: 'This Link'"
end
etc,etc,etc,etc,etc!!!!!
That's 5 lines per link -- there has to be a better way! I researched
the assert commands and such, but there isn't much documentation on how
to use them.
How would a more experienced Watir/Ruby programmer address this issue?
I will be verifying links like this, specific images, body text. . .
believe it or not, the automated functions like logging in and moving
around seem much easier to me!
Thanks in advance,
Adam