Open source web testing tool
The future of automated web testing is open source

API Guide - Table Row

Courses in c#, ruby, shell scripting, Software testing courses and more

See a video tour
Thwameva technologies offers a state of the art advanced training using multimedia video mentoring , practical oriented training and experts as mentors(*). Thwameva offers software testing courses, courses in WET, ruby, C#, shell scripting and more...
The unique combination of video mentoring by experts and mentor assisted training programs are applicable only for software training courses in Thwameva's Bangalore office.

Thwameva technologies is the primary sponsor for the WET project
 
Main       Web Objects       Win Objects       Test Mgmt       Others      
Class WET::WebTableRow
In: WebTableRow.rb
Parent: WebContainer

Class to represent a single row insude a HTML Table.A Row is a full blown container.You could use the various methods to create Web objects just as you would use a browser or Frame.For example you could say:

   Browser(...).Table(...).Row(...).Image(...)

Check the *WebContainer*document for details about the container methods.

Methods

Methods Inherited from WebContainer

Button   Checkbox   File   IFrame   Image   Link   List   Radio   Table   TextField   Textarea   button   checkbox   div   element_by_tagname   file_field   iframe   image   link   p   radio   select_list   span   table   text_field   textarea  

Methods Inherited from WebObject

browser   exists?   fire_event   id   index   is_exist   name   tag_name  

External Aliases

wait -> waitForIE

Public Class methods

Constructor - Scripts should not directly create instances of Rows.Instead you should use the WebTable.Row(*args) method provided by Web Tables.

The parameters used to identify a row are

 text  -  text displayed on the row
 index

Public Instance methods

Get a single cell corresponding to the parameters.The parameters usually used are : text index

cell(*params)

Alias for Cell

Check to see if the row actually exists on the page.If the row actually does exist,then prints out a success message in the test report.If it doesn’t exist,then it prints out a failure in the report. One example of using this check is immediately after performing ‘add’operaions. For example,after adding a new user,you may want to check that the user link actually does exist.

Check to see if the row *does not*exist on the page.If the row does not exist,then prints out a success message in the test report.If it actually does exist,then it prints out a failure in the report. One example of using this check is immediately after performing ‘delete’ operations. For example,after deleting user ‘abc’,you may want to check that the user link for ‘abc’has been deleted.

    Check to see if the expected text matches the text of the table row.If the row's text matches the search_text,

then a success message is printed in the test report.Otherwise,a failure is printed out in the reported.

Check to see if the expected text does not match the text of the row.If the check is successful,that is,the row’s text does not match the expected text,then a success is printed in the test report.If the check fails,then a failure is printed in the test report.

Gets the total number of columns in this row.

Gets the text for this row.The text for a row is the aggregate of the text of all the cells in this row

:startdoc

Methods Inherited from the WebContainer class

Find a Button with the specified properties, The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The common properties used to identify a button are :

  • name - The html name attribute of the button
  • id - The html id attribute of the button
  • value - The value of the button is the text displayed on the button.

Find a Web checkbox with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a checkfield are:

  • name - The html name attribute of the checkbox
  • id - The html id attribute of the checkbox
  • label - The checkbox’s label. The checkbox’s label is the text that is
     displayed to the left of the checkbox.
    

Find a Web File with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a File are:

  • name - The html name attribute of the file element
  • id - The html name attribute of the file element
  • label - The File element’s label. The label of a file element is the
     text displayed to the left of the file.
    

Find an IFrame with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a Textarea are:

  • name - The html name attribute of the text area
  • id - The html id attribute of the text area.
  • text - The text contained in the IFrame

Find an Image with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The common properties for an image are

  • id - The html id attribute of the image
  • src - The source path

Get a web Link with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

For a link the following are the commonly used properties:

  • id - The html id attribute of the link
  • text - Text that is displayed for the link.
  • href - Url to which this link points to

Find a Web List with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a List are:

  • name - The html name attribute of the web list
  • id - The html id attribute of the web list.
  • label - The Lists’s label. A lists label is the text that is
     displayed to the left of the weblist
    

Find a Web radio button with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a radio button are:

  • name - The html name attribute of the radio button
  • id - The html id attribute of the radio button
  • label - The radio button’s label. In the case of a radio button, the
     label is considered to be the textimmediately after the radio.
    

Find a HTML Table with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties with which a table can be identified are:

  • id - The html id of the table
  • text - This is a very useful way to identify a table. Sometimes the only
     info that is available about a table is the text contained in the table.
     The table's text is the aggregate of the contents of the cells of the table.
    

Find a Web textfield with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a textfield are:

  • name - The html name attribute of the Textfield
  • id - The html id attribute of the Textfield
  • label - The textfield’s label. The textfield’s label is the text
     displayed to the left of the textfield.
    

Find a Textarea with the specified properties. The properties are specified as name-value pairs using the syntax:

    "property_name:=value"

The value can either be a string literal or a string representing a regular expression. To emulate a regular expressioin, the value starts and ends with the ’/’ character. For example, "name:=/some.*/"

The properties used to identify a Textarea are:

  • name - The html name attribute of the text area
  • id - The html id attribute of the text area.
button(*props)

Alias for Button

checkbox(*props)

Alias for Checkbox

Convenience method to access div elements

Get an element based on the tagname. This is useful for those cases where there is no predefined WET class for a particular tag but a scripter needs to use it.

  • tag_name = Name of the tag, eg. p, div, etc.,
  • props = Hashtable of name-value properties for searching.

For example if you want to get a <div> element whose id is ‘myId’, then you can say

    element_by_tag_name("div", "id" => "myId")
file_field(*props)

Alias for File

iframe(*props)

Alias for IFrame

image(*props)

Alias for Image

link(*props)

Alias for Link

Convenience method to access <p> elements

radio(*props)

Alias for Radio

select_list(*props)

Alias for List

Convenience method to access span elements

table(*props)

Alias for Table

text_field(*props)

Alias for TextField

textarea(*props)

Alias for Textarea

Methods inherited from Web Objects

Get the WebBrowser object which hosts this element

Check to see if the object exists or not at runtime.

Returns true if the object exists, false if it doesn’t

Emulate firing an event - For example - moving mouse over, etc,.

Get the ‘id’ attribute that is associated with this element

Get the index of this element w.r.t its container.

is_exist()

Alias for exists?

Get the ‘name’ attribute that is associated with this element

Get the html tag of this element. For example: <input> for textfield, <img> for image, etc.,

 

WET is a opensource automated web testing tool which uses Watir as the library to drive web pages. WET drives an IE Browser directly and so the automated testing done using WET is equivalent to how a user would drive the web pages. WET extends the scripting abilities of Watir and also offers the convenience of recorders. It is licensed under LGPL and BSD style open source licenses.

WWW wet.qantom.org
Search powered by Google