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

API Guide - Checkbox

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

Wrapper to represent a Web checkbox.

The checbox controls that are displayed on the web page.

Methods

Methods Inherited from WebObject

browser   exists?   fire_event   id   index   is_exist   name   tag_name  

Public Class methods

 Create a new WebCheckbox instance.Scripts should not directly instantiate a WebCheckbox directly.Instead you
 should call the Checkbox method of the WebContainer.Checkbox(*args)method.

The checkbox controls that are displayed on the web page. 1)Getting a reference of the required checkbox

   The syntax to get the reference of a Checkbox is:
   Container.Checkbox("name:=value")
   Where
   Container   is a Browser,Frame,Table or any other container that can hold HTML elements as its children
   name        is the name of the attribute to be checked
   value       is the value of that attribute.

 Example
    Browser("title:=Controls").Checkbox("label:=Are you sure")

    The commonly used attributes to identify a checkbox are:
    name      The HTML name attribute of the checkbox
    id        The HTML id attribute of the checkbox
    label     The label for this checkbox

 Tip:To construct the definition for a radio,use the container's show_objects('Checkbox')method.Then pick the
 one that is appropriate for the Checkbox of interest and copy paste it into your script.

Public Instance methods

Check to see if the checkbox actually exists on the page.If the checkbox 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 checkbox *does not*exist on the page.If the checkbox 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 immedaiately after performing ‘delete’ operations.For example,after deleting user ‘abc’,you may want to check that the user link for ‘abc’has been deleted.

This method is used to verify that the current value of ‘name’property matches the expected value.The property to be checked is the first parameter and the expected value is the second parameter.There are various properties that you can use for a checkbox.The commonly used ones are:

   name     The html name attribute of the checkbox
   id       The html id attribute of the checkbox
   label    The label for this checkbox
   suffix   The suffix for a checkbox is the text that is immediately after the checkbox.This is typically used
            when the checkbox's identification text is place immediately after the checkbox and this string is NOT set as
            (html)label for the checkbox itself

checked Whether or not the checkbox in the checked state.

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

If the result is a success then prints a Seccess to the report.Otherwise prints a failure.

Clear is the flip operation of Set.In this case the checkbox’s state is set to UNCHECKED.It is equivalent to clicking the checkbox when it is initially checked.

This method checks if the checkbox is set to ON state after we have set the checkbox to ON.If it is not set to ON, then it prints as failed.

Set the checkbox to enabled state (or ON state).It is equivalent to clicking the checkbox when it is initially This command is used to emulate the action of a user setting the checkbox’s state to CHECKED.

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