Command Summary

 
Find below a detailed description of the commands that are embedded in the webscript during web page recording. The commands are grouped based on objects/elements. Also, links are provided to the properties of the HTML elements that are captured during recording.

 

  1. Timeout indicates the time in seconds to wait before executing that command of the webscript. Default timeout set during recording is 2 seconds. You can change it as per your requirements.

  2. Provision to play elements with dynamic properties, i.e., properties change each time the script is played. In the list of functions below, *** denote the function which provides this facility.

 

Window Related [ Properties List ]

 

Command Inference

Syntax

Return Value

Sample

setWindow

A reference of the window whose actions are going to be recorded needs to be noted. setWindow records the "window title" of the window currently under recording. Based on this, the window elements/objects are identified.

setWindow("Window ID",timeout)

0 for Success

1 for Failure

setWindow("AdventNet Payroll System",2)

setDynamicWindow

To dynamically identify and get the reference of a window during playback for the given parameters. Based on this, you can insert other built-in functions in the subsequent lines to identify the elements/objects in this window. The parameters include:

1st argument - parent_window_title
2nd argument - parent_window_occurence,
3rd argument - Title or Name as the property name. Here, Title is the frame_window_title and Name is the frame_window_name.
4th argument - Value of the Title or Name specified in the 3rd argument.
5th argument - frame_window_occurence

setDynamicWindow

(parent_window_title,parent_window_index,frame_window_title or frame_window_name,value_of_frame_title or value_of_name,frame_window_index)

0 for Success

1 for Failure

Eg: setDynamicWindow("AdventNet",1,"frame_window_title","payroll",1)

 

closeAllWindows

To dynamically close all the windows opened during playback. No parameters required.

 

NA

0 for Success

1 for Failure

-

doesWindowExists

 To dynamically check whether the window for the given parameters exists or not. If exists return 0(true), else 1(false). The parameters include:

1st argument - parent_window_title

2nd argument - parent_window_occurence,

3rd argument - Title or Name as the property name. Here, Title is the frame_window_title and Name is the frame_window_name.

4th argument - Value of the Title or Name specified in the 3rd argument.

5th argument - frame_window_occurence

 

doesWindowExists

(parent_window_title,parent_window_index,frame_window_title or frame_window_name,value_of_frame_title or value_of_name,frame_window_index)

0 for Success

1 for Failure

Eg: doesWindowExists("AdventNet",1,"frame_window_title","payroll",1)

closeWindow

Close the window whose ID is specified as argument.

closeWindow("Window ID",timeout)

0 for Success

1 for Failure

closeWindow("AdventNet Payroll System",4)

setAlertWindow

Record the window title of message windows such as Alert, Prompt and Confirm.

setAlertWindow("Window ID",timeout)

 

0 for Success

1 for Failure

setAlertWindow( "Microsoft Internet Explorer",2)

 

closeAlertWindow

Close the alert/Prompt/Confirm window whose ID is specified as argument.

closeAlertWindow("Window ID",timeout)

0 for Success

1 for Failure

closeAlertWindow( "Microsoft Internet Explorer",2)

 

setDialog

Record Modal/Modeless dialogs based on window title.

setDialog("Window ID",timeout)

0 for Success

1 for Failure

setDialog( "Web Dialog",2)

 

closeDialog

Close the dialog window whose ID is specified as argument.

closeDialog("Window ID",timeout)

 

0 for Success

1 for Failure

closeDialog( "Web Dialog",2)

 

clickMainToolBarButton

Record the click on the toolbar icons/images/buttons of the browser, such as Back, Forward etc.

clickMainToolBarButton("Object ID",timeout)

0 for Success

1 for Failure

clickMainToolBarButton("Forward",timeout)

 

Form Elements Related

 

Edit / Password Object [ Properties List ]

 

Command Inference

Syntax

Return Value

Sample

***

setText

Record the text entered in the edit, textarea or password object. In case of password object, the encrypted value is displayed in the script.

setText("Object ID", "value", timeout)

 

 

With Dynamic Property

 

setText("Object ID", "value", timeout, "Property", "value")

 

 

0 for Success

1 for Failure

setText("userid","Mary_br",5)

 

setText("textarea","Music and Gardening",7)

 

setText("password","A{y a8u ",3)

 

With Dynamic Property

 

setText("userid","Mary_br",5,"id","5")

 
 

Radio / Checkbox / Push Button [ Properties List ]

 

Command Inference

Syntax

Return Value

Sample

***clickButton

Record the Click event on the button which can be one of the following:

  • Radio button

  • Checkbox

  • Push button

clickButton("Object ID",timeout)

 

With Dynamic Property

 

clickButton("Object ID",timeout,"Property","Value")

 

 

 

0 for Success

1 for Failure

clickButton("radio1",2)

 

With Dynamic Property

 

clickButton("radio1",2,"id","3")

 

 
 

Single Select / Multiple Select Object [ Properties List ]

 

Command Inference

Syntax

Return Value

Sample

***

selectItem

Record the value(s) chosen in the Select Object.

In case of multiple values chosen in a Multi Select Object, the values are concatenated using :-: .

selectItem("Object ID", "value", timeout)

 

With Dynamic Property

 

selectItem("Object ID", "value", timeout,"Property","value")

 

0 for Success

1 for Failure

selectItem("department","Testing",4)

 

selectItem("department","Testing:-:Sales:-:Accounts",4)

 

With Dynamic Property

 

selectItem("department","Testing",4,"id","5")

 

 

 
 

Image Object [ Properties List ]

 

Command Inference

Syntax

Return Value

Sample

***

clickImage

Record the file URL of the image which was clicked.

clickImage("URL",timeout)

 

With Dynamic Property

 

clickImage("URL",timeout, "Property","value")

 

0 for Success

1 for Failure

clickImage("file://C:/images\new.png",3)

 

With Dynamic Property

 

clickImage("file://C:/images\new.png",3,"source","file://C:/images\old.png")

 

 

 
   

Link Object [ Properties List ]

 

Command Inference

Syntax

Return Value

Sample

***

clickLink

Record the link name (inner text) of the Hyperlink which was clicked.

clickLink("Link name",timeout)

 

With Dynamic Property

 

clickLink("Link name",timeout, "Property", "value")

 

 

 

0 for Success

1 for Failure

clickLink("Web Server",2)

 

With Dynamic Property

 

clickLink("Web Server",2,"innerttext","HostServer")

 

 

 
 

Menus Related

 

Command Inference

Syntax

Return Value

Sample

***

clickList

Record the menu options generated using javascript.

 

Refer to the sample page present at <QEngine Home>/examples/payrollsystem/index.html.

This contains menu generated using javascript.

clickList("menu option name",timeout)

 

With Dynamic Property

 

clickList("menu option name",timeout,"Property","value")

 

0 for Success

1 for Failure

clickList("Add",2)

 

With Dynamic Property

 

clickList("Add",2,"id","2")

 

 

***

showContextMenu

Display the context menu (invoked using onContextMenu event in the HTML page).

showContextMenu("Object ID", timeout)

 

With Dynamic Property

 

showContextMenu("Object ID", timeout,"Property","value")

 

 

0 for Success

1 for Failure

showContextMenu("List1", 2)

With Dynamic Property

 

showContextMenu("List1", 2,"id","4")

 

 

 
 

Map Area

 

Command Inference

Syntax

Return Value

Sample

***

clickMap

Record the action when a particular area of a map area is clicked.

clickMap("Link name",timeout)

 

With Dynamic Property

 

clickMap("Link name",timeout,"Property","value")

 

 

0 for Success

1 for Failure

clickMap("Web Server",2)

 

With Dynamic Property

 

clickMap("Web Server",2,"id","5")

 

 

 
 

Element

 

Command Inference

Syntax

Return Value

Sample

***

clickElement

Record the action performed on <SPAN> or <TD>

clickElement("Object ID",timeout)

 

With Dynamic Property

 

clickElement("Object ID",timeout,"Property","value")

 

 

0 for Success

1 for Failure

clickElement("domAPI_Elm_12",3)

 

With Dynamic Property

 

clickElement("domAPI_Elm_12",3,"id","8")

 

 
 

  Parameterization

 

Command Inference

Syntax

Return Value

Sample

initDB

Set the Database Identification from where values need to be retrieved.

 

Based on the Data Configuration set, the dbid will be automatically set. When you choose to import data from a DB and specify the connection details, the dbid is automatically assigned.

 

For more details, refer "Data Configuration".

initDB("dbid")

0 for Success

1 for Failure

initDB("1.1")

initCSV

Set the File name from where values need to be retrieved.

 

For sample, refer "Illustrating for construct".

initCSV("filename")

0 for Success

1 for Failure

initCSV("C:\a.csv")

getDBValueAt

 

In Data Configuration tool, if database field value is identified based on Row and Column, then this function is inserted in the script.

 

Note initDB() must precede this line.

initDB("dbid")

getDBValueAt("sql",rowindex,colindex)

Column value

initDB("1.1")

getDBValueAt("select * from emp;",1,1)

getDBValue

In Data Configuration tool, if database field value is identified based on field/column name, then this function is inserted in the script.

Note initDB() must precede this line.

initDB("dbid")

 

getDBValue("sql",rowindex,"columnname")

Column Value

initDB("1.1")

getDBValue("select * from emp;",1,"empno")

getCSVValueAt

In Data Configuration tool, if a value in the Comma Separated File (CSV) is identified based on Row and Column, then this function is inserted in the script.

 

Note initCSV() must precede this line.

initCSV("filename")

getCSVValueAt(rowindex,colindex)

Value

initCSV("C:\a.csv")

getCSVValueAt(1,2)

 
  

XML Validation Functions

 

Command

Purpose

Syntax

Return Value

doesNodeContainValue

To check whether the specified node contains  the given value in the XML file.

doesNodeContainValue(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xpath = Valid xpath.

0 for Success

1 for Failure

getNodeAttribute

To get the node attribute from the specified XML file.

getNodeAttribute(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

String

geNodeCount

To get the node count from the specified XML file.

geNodeCount(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

Int

getNodeValue

To get the node value from the specified XML file.

getNodeValue(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

String

getNodeValues

To get the node values from the specified XML file.

getNodeValues(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

String

getTextNodeValues

To get the text node values from the specified XML file.

getTextNodeValues(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

String

isNodePresent

To check whether the specified node is present in the  XML file.

isNodePresent(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = xpath.alid XML file path.

xmlpath = Valid xpath.

0 for Success

1 for Failure

isXMLIdentical

To check whether the two XML files has the same set of node values in the same order.

isXMLIdentical(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

0 for Success

1 for Failure

isXMLSimilar

To check whether the two XML files has the same set of node values wherein the order can differ.

isXMLSimilar(xmlfile,expression(xpath))

 

To know the appropriate xml expression to be used, please refer to this URL http://javaalmanac.com/egs/org.w3c.dom/xpath_GetChildElem.html

xml file = Valid XML file path.

xmlpath = Valid xpath.

0 for Success

1 for Failure

 

String Handling Functions

 

Command

Purpose

Syntax

Return Value

endsWith

To check whether the specified String ("String_Value") ends with the specified end string value.

endsWith("String_Value","End_String_Value")

0 for Success

1 for Failure

indexOf

To get the index within this string ("String_Value") of the first occurrence of the specified pattern string.

indexOf("String_Value","Pattern_String")

Integer

length

To get the length of the string.

length("String_Value")

Integer

replaceAll

To replace each substring of this string that matches the given search pattern with the  given replace string.

replaceAll("String_Value","Search_Pattern","Replace_String")

String

replaceFirst

To replace the  first substring of this string that matches the given search pattern with the  given replace string.

replaceFirst("String_Value","Search_Pattern","Replace_String")

String

split

To split this string around matches of the given separator.

split("String_Value","Separator")

String Array

startsWith

To check whether the  string starts with the specified start string name.

startsWith("String_Value","Start_String_Value")

0 for Success

1 for Failure

subString

To returns a new string that is a substring of this string.

subString("String_Value","Start_Index","End_Index")

String

toLowerCase

To convert the specified string to lowercase.

toLowerCase("String_Value")

String

getLocaleDetails

Returns the selected locale.

getLocaleDetails()

String

getLocalizedString

Returns the localized string for the given key.

getLocalizedString("String"). String is the property name in the map file.

String

toUpperCase

To convert the specified string to uppercase.

toUpperCase("String_Value")

String

 

HTML Check Functions [ Properties List ]

 

Built-In Function Purpose

Syntax

Return Value

Sample

linkCheckInfo

To compare the value of the specified property of a link object with the given value.

linkCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

linkCheckInfo("www.adventnet.com",

"innertext","www.adventnet.com")

checkCellValueAt

To compare the value of the specified table cell property with the given value.

checkCellValueAt("Element ID")

ElementID =  Generated by QEngine.

0 for success.

1 for failure.

checkCellValueAt ("S.No","cellvalue","Product")

editCheckInfo

To compare the value of the specified property of a edit object with the given value.

editCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

 

0 for Success

1 for Failure

editCheckInfo("yourname_1","value","Mary")

doesColumnContain

Checks if the selected HTML Table cell value is found in the specified column of the  resultset after query execution.

doesColumnContain("Element ID","HTML Table Row Index", "HTML Table Column Index", "String sql query", "DB Column Index" or "DB Column Name")

0 for Success

1 for Failure

when ColumnName is selected

initDB("1.1")

doesColumnContain("S.No",3,4,"select name from emptable","name")

 

when ColumnIndex is selected

initDB("1.1")

doesColumnContain("S.No",10,4,"select name from emptable",1)

imageCheckInfo

To compare the value of the specified property of a image object with the given value.

imageCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Image Property name to be checked.

Value = Required Image Property value to be checked.

 

0 for Success

1 for Failure

imageCheckInfo("http://www.adventnet.com

/images/free-edition-appmanager.gif","source",

"http://www.adventnet.com/images/free-edition-appmanager.gif")

buttonCheckInfo

To compare the value of the specified property of a button object with the given value. The object can be a push button, radio button, checkbox, submit and reset.

buttonCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

buttonCheckInfo("language_3","status","true")

selectCheckInfo

To compare the value of the specified property of a single selection and multi selection list box (combo box) object

with the given value.

selectCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

selectCheckInfo("department_1","selecteditems",

"Sales")

winCheckInfo

To compare the value of the specified property of a window object with the given value.

winCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

winCheckInfo("The Product Presentation Team","windowtitle",

"The Product Presentation Team")

staticCheckInfo

To compare the properties of the popups message with the specified value.

staticCheckInfo("Object ID","property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

staticCheckInfo("Static","value","Choose the communication type")

pageCheckInfo

To compare the value of the specified property of a page object with the given value.

pageCheckInfo("Object ID", "property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

pageCheckInfo("AdventNet Payroll System Package - Form to Add Employee Details","windowtitle",

"AdventNet Payroll System Package - Form to Add Employee Details")

webCheckText

To check if a particular text exists on the web page under test.

webCheckText("search text", "prefix","suffix")

0 for Success

1 for Failure

webCheckText("Product","The","name")

styleCheckInfo

To validate the style properties of a html element. The style properties that can be validated are cursor, color, background-color, font, font-family, font-size, font-style, text-decoration, width, height, background-image and text-align.

styleCheckInfo("ElementID ","Property",

"value")

ElementID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

styleCheckInfo("Test Plans","font-style",

"normal")

listCheckInfo

 To compare the value of the specified property of an <LI> element or <DIV> element with the given value.

listCheckInfo("Object ID","property","value")

ObjectID = Generated by QEngine.

Property = Required Property name to be checked.

Value = Required Property value to be checked.

0 for Success

1 for Failure

 

 listCheckInfo("li1", "name","listelement1")

 

 

 

Data Retrieval Functions [ Properties List ]

 

Built-In Function Purpose

Syntax

 

Return Value

Sample

linkGetInfo

To retrieve the value of the specified property of a link object.

result = linkGetInfo("Object ID", "property")

objectID = Generated by QEngine.

property = Property to be retrieved.

Value of the specified property

result=linkGetInfo("www.adventnet.com","innertext")

displayMessage(result)

 

 

editGetInfo

To retrieve the value of the specified property of a text object.

result = editGetInfo("Object ID", "property")

objectID = Generated by QEngine.

property = Property to be retrieved.

 

Value of the specified property

result=editGetInfo("yourname","value")

displayMessage(result)

 

imageGetInfo

To retrieve the value of the specified property of an image object.

result = imageGetInfo("Object ID", "property")

objectID = Generated by QEngine.

property = Property to be retrieved.

Value of the specified property

result=imageGetInfo("http://www.adventnet.com/

images/free-edition-appmanager.gif","source")

displayMessage(result)

 

buttonGetInfo

To retrieve the value of the specified property of a button object. The object can be a push button, radio button, checkbox, submit and reset.

result = buttonGetInfo("Object ID", "property")

objectID = Generated by QEngine.

property = Property to be retrieved.

Value of the specified property

result=buttonGetInfo("gender","defaultChecked")

displayMessage(result)

 

selectGetInfo

To retrieve the value of the specified property of a single selection and multi selection list box (combo box) object.

result = selectGetInfo("Object ID", "property")

objectID = Generated by QEngine.

property = Property to be retrieved.

Value of the specified property

result=selectGetInfo("department","selectedcount")

displayMessage(result)

 

 

listGetInfo

 

 

 

 

 

To retrieve the value of the specified property of an <LI> element and <DIV> element.

 

result = listGetInfo("Object ID", "property")

objectID = Generated by QEngine.

property = Property to be retrieved.

Value of the specified property

result=listGetInfo("list1","value")

displayMessage(result)

winGetInfo

To retrieve the value of the specified property of the selected window.

result = winGetInfo("Object ID", "property")

 

ObjectID = generated by QEngine.

Property = Property to be retrieved.

Value of the specified property

result=winGetInfo("AdventNet Payroll System

 Package - Form to Add Employee Details",

"framecount")

displayMessage(result)

 

pageGetInfo

To retrieve the value of the specified property of the selected page.

result = pageGetInfo("Object ID", "property")

 

 

 

Value of the specified property

result=pageGetInfo("AdventNet Payroll System

Package - Form to Add Employee Details","response_time")

displayMessage(result)

 

getLastError

To retrieve the error (if any) thrown by the last script statement that was executed before getLastError () was invoked.

result =getLastError()

String Error message generated by the previous.

result =getLastError()

displayMessage(result)

 

getPopUpText

To read the text message displayed in the popup.

result =getPopUpText()

String

result =getPopUpText()

displayMessage(result)

getUnExpectedPopUpTitle

 

During playback, if any popup that was not encountered during recording, appears then it is called unexpected popup and you can read the title of the popup using this function.

result =getUnExpectedPopUpTitle()

String

result =getUnExpectedPopUpTitle()

displayMessage(result)

 

getCSVValueAt

In Data Configuration tool, if a value in the Comma Separated File (CSV) is identified based on Row and Column, then this function is inserted in the script.

 

Note initCSV() must precede this line.

initCSV("filename")

getCSVValueAt(rowindex,colindex)

Value

initCSV("C:\a.csv")

for i in range (0,4):

for j in range (0,4):

result = getCSValueAt(i,j)

displayMessage(result)

 

 

HTML Table Related

 

Command Inference

Syntax

Return Value

Sample

getAllHTMLTableCells

To retrieve all the table cell values for the selected table.

getAllHTMLTableCells("Element ID")

Element ID = Generated by QEngine

 

Two dimensional array object containing the values of all the table cells

result=getAllHTMLTableCells("element ")

 

You can verify the output of the function by iterating through the returned object.

E.g

for i in range(0,len(result)):

  for j in range(0,len(result[i])):

        displayMessage(str(result[i][j]))

getHTMLTableColumnValues

To retrieve the table column values for the given column index

getHTMLTableColumnValues("Element ID","Column Index")

Element ID = Generated by QEngine.

Column Index = Index of the column to be retrieved.

Array object containing the column values for the given column index

E.g.

result = getHTMLTableColumnValues("S.No_1",2)

for i in range(0,len(result)):

displayMessage(st(result[i]))

getHTMLTableRowCount

To retrieve the number of the rows from the selected table.

result=getHTMLTableRowCount("Object ID")

Object ID =Generated by QEngine.

Integer

result=getHTMLTableRowCount("Employee N")

displayMessage(result)

getHTMLTableColumnCount

To retrieve the number of the columns from the selected table.

result=getHTMLTableColumnCount("Object ID")

Object ID =Generated by QEngine.

Integer

result=getHTMLTableColumnCount("Employee N")

displayMessage(result)

getCellElementProperty

To get the property value of a HTML Element inside a HTML Table Cell Element.

getCellElementProperty(tableid,rowindex, colindex, property needed,[tag],[propertyname],[propertyvalue],[index])

 

Mandatory Parameters:

1. tableid = Generated by QEngine.

2. rowindex = row no in the table.

3. colindex = column no in the table.

4. property needed = property for which the value need to be fetched.

 

Optional Parameters:

1. tag = tagname of the elements.

2. propertyname = property to be matched.

3. propertyvalue = property value to be matched.

4. index = occurence of the elements.

String

getCellElementProperty("Employee N",1, 3, "value")

fireEventOnCellElement

To invoke or fire the specified event for the given HTML Table Cell element.

fireEventOnCellElement(tableid,rowindex, colindex, actionname,[actionvalue],[tag],[propertyname],[propertyvalue],[index])

 

Mandatory Parameters :

1. tableid = Generated by QEngine.

2. rowindex = row no in the table.

3. colindex = column no in the table.

4. actionname = action or the event to be fired.

(click, doubleclick, mouseover, select, settext, etc.)

 

Optional parameters :

1. actionvalue = required only for setText and selectedItem events.

2. tag = tagname of the element.

3. propertyname = property to be matched.

4. propertyvalue = property value to be matched.

5. index = occurance of the element.

-NA-

fireEventOnCellElement("TableID",2,3,"click","",

"INPUT","id","buttonid",1)

 

The above statement in the script will click a input button whose id is "buttonid" which is present in the 2nd row, 3rd column of the table where "TableID" is the ID generated by QEngine.

getCellValueAt()

To retrieve the value of the specified cell from the table.

result=getCellValueAt("Object ID", row index, column index)

 

Mandatory Parameters :

1. tableid = Generated by QEngine.

2. rowindex = row no in the table.

3. colindex = column no in the table.

Value of the specified cell

result=getCellValueAt("Employee N",2,2)

displayMessage(result)

 

Database Related

 

Command Inference

Syntax

Return Value

Sample

getDBValues()

To retrieve the recordset from DB after executing the specified sql query.

result=getDBValues("sql query")

objectID = Generated by QEngine.

rowindex = rowno of the table.

columnindex = columnno of the table.

Two dimensional String array

To display all the values retrieved by the below query.

result=getDBValues("Select * from LoginTable")

for i in range (0,len (result));

for j in range (0,len (result[i]));

displayMessage (result[i] [j])

getDBValueAt()

To retrieve  the value from the specified row and column from DB after executing the specified sql query.

result=getDBValueAt("sql query,rowIndex,columnIndex")

String

To display the value at the 1st row, 2nd column value of the query result.

result=getDBValueAt("Select * from LoginTable",1,2)

displayMessage(result)

getDBTableRowCount()

To retrieve the Row count from DB after executing the specified sql query.

result=getDBTableRowCount("sql query")

String

To display the row count of the query result.

result=getDBTableRowCount("Select * from LoginTable")

displayMessage(result)

writeToDB

To execute the specified sql query and write the resultset to the database.

result=writeToDB("sql")

0 for Success

1 for Failure

result=writeToDB("Insert into employee ("emp_id","emp_name","dept") values("emp1","peter",payroll")")

getDBTableColumnCount()

To retrieve the Column count from DB after executing the specified sql query.

result=getDBTableColumnCount("sql query")

String

result=getDBTableColumnCount("Select * from LoginTable")

displayMessage(result)

 

Test Case Related

 

Command Inference

Syntax

Return Value

Sample

executeTest

Execute the test case whose name is specified as argument.

For more details refer "Inserting Test Cases".

executeTest("Test Case name")

0 for Success

1 for Failure

executeTest("name-check")

 
 

Invoking other Web Scripts and Applications

 

Command Inference

Syntax

Return Value

Sample

callScript

Invoke another web script from the one currently being executed.

 

For more details refer "Chaining the Scripts".

callScript("Web Script Name","Web Script Path")

Mandatory Parameters:

WebScriptName = Script name to be called.

WebScriptPath = Script path (relative to the web scripts directory).

Whether script execution successfully completed or not.

callScript("test","case1/test")

callScriptUpto

Invoke another web script from the one currently being executed.

 

Execute up to the line number specifed.

 

For more details refer "Chaining the Scripts".

 

callScriptUpto("Web Script Name","Web Script Path", Line number)

Whether script execution successfully completed or not.

callScriptUpto("test","case1/test",75)

 

invokeApplication

Invoke any application (.exe, .bat etc) running in the system.

 

Current script execution will be suspended till the called Application is executed completely.

invokeApplication("Command line")

Status String

 

invokeApplication("C:\Mozilla\Mozilla.exe")

 

invokeApplicationInThread

Invoke any application (.exe, .bat etc) running in the system.

 

Called Application will be started on new thread. Calling script's execution will continue

invokeApplicationInThread("Command line")

 

Status String

 

invokeApplicationInThread("C:\Mozilla\Mozilla.exe")

 

 

Play Initialization

 

Command Inference

Syntax

Return value

Sample

useLocalMapFile

Use the map file which is local to this webscript.

 

Refer "Configuring Map File Mode" for more details.

useLocalMapFile()

-NA-

useLocalMapFile()

launchApplication

Open the web browser and load the page specified by the URL.

 

Refer "Setting Preferences" for details on web browser selection.

launchApplication("URL")

0 for Success

1 for Failure

launchApplication("http://www.adventnet.com")

changeURL

Load another page in an already launched web browser by specifying the URL.

changeURL("URL",timeout)

0 for Success

1 for Failure

 

changeURL("http://www.yahoo.com",5)

 

General Functions

 

Built-In Function Purpose

Syntax

Return value

Sample

saveLogs()

Saves the test execution logs  with the specified file name.

saveLogs(LogFileName)

-NA-

saveLogs("mymodulelogs")

displayMessage

To display user defined message in the logs.

displayMessage("Message to be displayed")

 

-NA-

 

displayMessage("Result = "+var)

reportStatus

To display user defined status in the script reports.

 

Status Id is user defined; any value can be specified for identification.

 

result can be 0 or 1 only. 0 for Success and 1 for Failure.

 

remarks can be any textual comment to be displayed in the reports.

reportStatus("Status Id", result, remarks)

statusid = ID to be displayed in teh reports.

result = 0-passed ; 1-failed

remarks = Remarks to be displayed in the reports

-NA-

 

result=getRowCount("Employee N")

 

if result == 5:

reportStatus("rowcnt",0, "Row count is Correct")

else:

reportStatus("rowcnt",1, "Invalid Row count")

reportTestCase

To display the test case status (passed or failed) in the test case report.

reportTestCase(caseid,result,remarks,severity)

caseid = ID to be displayed in teh reports.

result = 0-passed ; 1-failed

remarks = Remarks to be displayed in the reports.

severity = Severity of the case.

-NA-

result=selectCheckInfo("department_1","selecteditems",

"Sales")

if result == 0:

   reportTestCase("tstStatus",0, "SelectCheckInfo Passed")

else:

   reportTestCase("tstStatus",1, "SelectCheckInfo Failed","Critical")

wait

To pause the script execution for n seconds.

wait(seconds)

-NA-

 

wait(5)

closeUnExpectedPopUp

During playback, if any popup that was not encountered during recording, appears then it is called unexpected popup and you can close the same using this function.

 

closeUnExpectedPopUp("Window Title",timeout)

0 for Success

1 for Failure

 

result =closeUnExpectedPopUp(result,

2)

 

selectItemWithIndex

To select the item in the dropdown list based on the specified index value.

selectItemWithIndex("Element ID","Element index", waittime)

0 for Success

1 for Failure

result =selectItemWithIndex("department_1",5,

1))

 

saveScreenShot

When any error is encountered during the execution of the webscript, the snapshot of the client screen can be taken using this function.

 

The screen shot will be saved in the file whose name is specified as the first argument. The file will be saved under <QEngine Home/projects/<suite name>/webreports/screenshots folder.

This will happen after the n seconds specified as waittime.

saveScreenShot("filename",waittime)

0 for Success

1 for Failure

saveScreenShot("a",10)

stop

To stop the execution of the webscript.

stop()

0 for Success

1 for Failure

stop()

*** fireMouseOver

To invoke the onMouseOver action on the HTML object over which the mouse pointer is placed.

fireMouseOver("Object ID", timeout)

 

With Dynamic Property

 

fireMouseOver("Object ID", timeout,"Property","value")

Mandatory Parameters :

 

Object ID = Generated by QEngine.

 

Optional Parameters :

 

Property = Property name to be overwritten with dynamic value.

Value = Dynamic value of the property name specified.

0 for Success

1 for Failure

 

fireMouseOver("link1",2)

 

With Dynamic Property

 

fireMouseOver("link1",2,"innertext","link2")

 

If the innertext of "link" has changed to "links", then you can use the same function by overwriting the value of innertext as above.