|
| Ajax Functions : | Function Index |
Function
Description:
Using this function you can enable /
disable AJAX element handling in the runtime. During playback,
the test waits until the element is loaded or identified for each of
the user actions placed after the enableWaitForElement(). You can use
the first parameter of this function to enable/disable the wait time
action for specific user actions.
The parameters include:
1st argument - Accepts true or false to enable or disable the wait time action for specific user actions.
2nd argument - The maximum time to wait
in seconds.
How
to Define:
enableWaitForElement(enable/disable,wait_time_in_secs)
Example:
enableWaitForElement("true",15)
In the above example the AJAX element
handling is enabled and the timeout for maximum wait is set as 15 secs.
Return Values:
0 for Success
1 for Failure
Function
Description:
This function is used in relation
to the enableWaitForElement(). Use this function to set the timeout
value (increase/decrease the value) to maximum wait time until the
specified HTML element is loaded or identified. This function should be
inserted just before the user actions for which you need to wait until
the HTML elements are loaded/identified.
How
to Define:
setWaitTimeForElement(wait_time_in_secs)
Example:
enableWaitForElement("true",10)
clickButton("Button1",2)
clickLink("Link1",2)
setWaitTimeForElement(20)
clickButton("Button2",2)
In the above
example, initially the maximum wait time to identify the button element
Button1 is 10 seconds. The setWaitTimeForElement()
is used to increase the maximum wait time for the next
clickButton()
which is 20 seconds wherein the test will wait for a maximum of 20
seconds to identify the button element Button2.
Return
Values:
0 for Success
1 for Failure
Function
Description:
During playback, the test waits
until the HTML Element with the given tag name and matching property
name and value is identified.
The parameters include:
tagname = Tag name of the HTML
element to be identified.
propertyname = Property name of the HTML element to be matched.
propertyvalue = Property value of the HTML element to be matched. The property value can also be given as a dynamic property using regular expressions. i.e., when the properties in your HTML page changes each time the script is replayed.
index = Occurrence of the element in the HTML page.
useRegExp =
Accepts true or false which
determines whether to use regular expression or not.
If false, property value will be matched
for equal condition. To know the details of using the regular
expressions, refer to the following link.
wait_time in secs = The maximum time to
wait in seconds.
How
to Define:
waitForDynamicElement("tagName", "propertyName",
"propertyValue", index, "useRegExp", "wait_time")
Example:
waitForDynamicElement("input", "type",
"button", 2, "false", 15)
Return Values:
0 for Success
1 for Failure
Function
Description:
During playback, the test waits
until the specified HTML Element with the given tag name and matching
property name and value, is removed from the HTML page.
The parameters
include:
tagname = Tag name of the HTML element to be identified.
propertyname = Property name of the HTML element to be matched.
propertyvalue = Property value of the HTML element to be matched. The property value can also be given as a dynamic property using regular expressions. i.e., when the properties in your HTML page changes each time the script is replayed.
index = Occurrence of the element in the HTML page.
useRegExp = Accepts true or false which determines whether to use regular expression or not.
If false, property value will be matched for equal condition. To know the details of using the regular expressions, refer to the following link.
wait_time in secs = The number of seconds
to wait to identify the specified HTML element.
How
to Define:
waitForDynamicElementRemoval("tagName", "propertyName",
"propertyValue", index, "useRegExp", "wait_time")
Example:
waitForDynamicElementRemoval("INPUT", "type",
"button", 2, "false", 15)
Return Values:
0 for Success
1 for Failure
Function
Description:
During playback, the test waits
until the specified HTML Element with the given Element ID is
identified.
The parameters include:
Element ID = The HTML element ID which has to be identified.
wait_time = The maximum time to
wait in
seconds.
How
to Define:
waitForElement("Element_ID", "wait_time")
Example:
waitForElement("department_1",15)
Return Values:
0 for Success
1 for Failure
Function
Description:
During playback, the test waits
until the HTML Element with the given Element ID is removed.
The
parameters include:
Element ID = The HTML element ID which has to be removed.
wait_time = The maximum time to
wait in
seconds.
How
to Define:
waitForElementRemoval("Element_ID", "wait_time")
Example:
waitForElementRemoval("department_1",15)
Return Values:
0 for Success
1 for Failure
Function
Description:
During playback, the test waits
until the specified search text (with the given prefix and suffix text)
appears in the HTML page that is identified in the last user action.
The parameters include:
Search_String = The text to be searched in the HTML page.
Prefix_String = The prefix string using which the search string has to be searched for.
Suffix_String = The suffix string
using
which the search string has to be searched for.
How
to Define:
waitForText("Search_String", "Prefix_String",
"Suffix_String", "Time_Out")
Example:
waitForText("Configure","Device","Parameters")
Return Values:
1 for Failure
Function
Description:
During playback, the test waits
until the specified window status
appears in the currently active window.
The parameters include:
Status_Text (Optional. Default Value:
Done) = The Status text which is verified to be shown in the
window status bar
wait_time = The maximum time to
wait in
seconds.
How
to Define:
waitForWindowStatus("Status_Text", "Time_Out")
Example:
waitForText("Done","10")
Return Values:
1 for Failure
Function
Description:
During playback, the test waits
until the specified window with specified title appears.
The parameters
include:
Window_Title = The window title to be searched.
Window_Index = The occurrence of
the
window, if there are one or more windows with the specified title exist.
Time_Out = The maximum time to wait
in
seconds until the specified window title is identified.
How
to Define:
waitForTitle("Window_Title", Index, Timeout_Value)
Example:
waitForElementRemoval("AdventNet_Payroll",
1, 15)
Return Values:
0 for Success
1 for Failure
|