![]()
API Guide - Textfield |
Courses in c#, ruby, shell scripting, Software testing courses and more
|
|||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| 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)
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.
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
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.
Check to see if the object exists or not at runtime.
Returns true if the object exists, false if it doesn’t
| 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. |