-
Notifications
You must be signed in to change notification settings - Fork 4
Pages
bret edited this page Sep 13, 2010
·
6 revisions
A new page, generated with WatirCraft’s page generator, will have this skeleton:
module projectname
class PageNamePage < ::Taza::Page endend
For each page, you will need to define the url, elements and fields you will want
to identify or manipulate while testing that page or using that page during the
course of a test.
To define the page url (takes into account the site URL):
url ‘pageurl’
To add elements you want to manipulate:
element(:next_button) {browser.button(:value, ‘Next’)}
Elements that support only display are:
- button
- cell
- hidden
- all non-control elements, including divs, spans and most other elements.
Elements that support both display and set are:
- text_field (both text boxes and text areas)
- hidden
- file_field
- select_list
- checkbox
To add fields (elements on a page that have values) you want to manipulate:
field(:name) {browser.text_field(:name, ‘user_name’)}