Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #4191
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!gegeweb.org!talisker.lacave.net!lacave.net!not-for-mail |
|---|---|
| From | TJ Wilkes <tjwilkes@live.com> |
| Newsgroups | comp.lang.ruby |
| Subject | Starting Method/Class issues |
| Date | Tue, 10 May 2011 12:32:47 -0500 |
| Organization | Service de news de lacave.net |
| Lines | 48 |
| Message-ID | <db27adb124f75fd3cd3e99b520e711c7@ruby-forum.com> (permalink) |
| NNTP-Posting-Host | bristol.highgroove.com |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | talisker.lacave.net 1305048793 65603 65.111.164.187 (10 May 2011 17:33:13 GMT) |
| X-Complaints-To | abuse@lacave.net |
| NNTP-Posting-Date | Tue, 10 May 2011 17:33:13 +0000 (UTC) |
| X-Received-From | This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway |
| X-Mail-Count | 382901 |
| X-Ml-Name | ruby-talk |
| X-Rubymirror | Yes |
| X-Ruby-Talk | <db27adb124f75fd3cd3e99b520e711c7@ruby-forum.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.ruby:4191 |
Show key headers only | View raw
Hi I've been learning Ruby to help with scripting some tests, but the
books I have are only using mathematical method/class creations and my
attempts to make my own methods are failing. Looking for some help with
the creation of two time savers.
Note: Using ruby 1.8.7 and Watir-webdriver as well as IE 9.
I'm trying to set up some page validation scripts but every attempt has
failed, these run prefectly fine in the program if I repeat them and
fill in linkX and PagetextX with specfics each time but i'd prefer to be
able to run each with a simple bit of code calling the function.
Such as: verify.LinkX("Terms")or verify.LinkX(href/ID/etc, "Terms")
#which would validate a link called Terms.
and verify.PagetextX("Your info is important").
Thanks for any help or direction,
TJ
Code samples below.
#First process--------------------------
puts "\n"
puts "Verifying (linkX)."
ie.link(:id, "(linkX)").exist?
print "Actual Result:"
if ie.text.include? "(linkX)"
puts " Test Passed. Found: 'LinkX'. Actual Results match expected
Results."
else
puts " Test Failed! Could not find: 'LinkX'."
end
ie.link(:href, /(linkx)/).click
#Second process-------------------------------
puts "\n"
puts "Checking for Page text '(PagetextX)'."
ie.text.include? "Govern Your Use of Our Site"
print "Actual Result:"
if ie.text.include? "(PagetextX)"
puts " Test Passed. Found the test string: '(PagetextX)'. Actual
Results match expected Results."
else
puts " Test Failed! Could not find: '(PagetextX)'."
end
-----------------------------------------------
--
Posted via http://www.ruby-forum.com/.
Back to comp.lang.ruby | Previous | Next — Next in thread | Find similar | Unroll thread
Starting Method/Class issues TJ Wilkes <tjwilkes@live.com> - 2011-05-10 12:32 -0500
Re: Starting Method/Class issues Robert Klemme <shortcutter@googlemail.com> - 2011-05-10 22:18 +0200
Re: Starting Method/Class issues 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-10 16:07 -0500
Re: Starting Method/Class issues TJ Wilkes <tjwilkes@live.com> - 2011-05-10 16:34 -0500
Re: Starting Method/Class issues 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-10 19:26 -0500
Re: Starting Method/Class issues Brian Candler <b.candler@pobox.com> - 2011-05-11 03:39 -0500
Re: Starting Method/Class issues TJ Wilkes <tjwilkes@live.com> - 2011-05-11 14:28 -0500
Re: Starting Method/Class issues 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-11 14:56 -0500
Re: Starting Method/Class issues TJ Wilkes <tjwilkes@live.com> - 2011-05-11 16:04 -0500
Re: Starting Method/Class issues 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-11 17:39 -0500
csiph-web