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

API Guide - Textfield

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::WebEdit
In: WebEdit.rb
Parent: WebObject

Wrapper class to represent a web textfield. Most of the functionality is taken care of by the parent class in Watir (TextField)

Methods

Methods Inherited from WebObject

browser   exists?   fire_event   id   index   is_exist   name   tag_name  

Public Class methods

Constructor to create a WebEdit. Scripts should not directly create instances of this class. It is typically done by the Containers (Browser, Frame & Table) using the WebContainer.TextField(*args) method.

Public Instance methods

Appends the text in the passed parameter to the end of the current text in the textfield.

Check to see if the textfield actually exists on the page.If the textfield 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’operations.For example,after adding a new user,you may want to check that the user link actually does exist.

Check to see if the textfield *does not*exist on the page.If the textfield 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 if a property's actual value matches the expected value.The property to be checked is the first parameter and
 the expected value is the second parameter.The common properties that are checked for a textfield are:

 name       -     The html name attribute of the textfield
 id         -     The html id attribute of the textfield.
 label      -     The text displayed next to the textfield which
                  typically identifies the purpose of the textfield.
 suffix     -     Sometimes it is useful to know that the text immediately after
                  the textfield.
 text       -     The current value of the textfield.
 readonly   -     Is the textfield readonly?

Besides the above properties you could use any of the properties of the MSHtml Edit object.The properties are enumerated at: msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/input_text.asp

If the result is a success then prints a Success to the report,otherwise prints a failure.

Check to see if the expected text matches the text of the textfield.If the textfield’s text matches the search_text,then a success message is printed in the test report. Otherwise,a failure is printed in the test report.

Check to see if the expected text does not match the text of the textfield.If the check is successful,that is,the textfield’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

Performs a clear operation,which clears the text of the required field.

clear text on the textfield without blocking the current process. This is typically required if the textfield has javascript events which does validation and these validation opens popups.

Sets the textfield’s text to ‘value’

set text on the textfield without blocking the current process. This is typically required if the textfield has javascript events which does validation and these validation opens popups.

Number of characters the textfield can hold.

Gets the current text value of the textfield.

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