17 Webdom Module

This chapter provides a complete listing and reference for the methods in the OpenScript WebDomService Class of Web Functional Module Application Programming Interface (API).

17.1 WebDomService API Reference

The following section provides an alphabetical listing of the methods in the OpenScript WebDomService API.

17.1.1 Alphabetical Command Listing

The following table lists the WebDomService API methods in alphabetical order.

Table 17-1 List of WebDomService Methods

Method Description

web.accButton

Identifies an accessibility button by its path.

web.accCheckBox

Identifies an accessibility checkbox by its path.

web.accComboBox

Identifies an accessibility combobox by its path.

web.accElement

Identifies an accessibility element by its recorded ID and path.

web.accListBox

Identifies an accessibility listbox by its path.

web.accMenu

Identifies an accessibility menu by its path.

web.accRadioButton

Identifies an accessibility radio button by its path.

web.accTextBox

Identifies an accessibility text box by its path.

web.addGlobalAssertText

Registers a text matching (assertion) test to run every time a page is requested.

web.addGlobalVerifyText

Registers a text matching (verification) test to run every time a page is requested.

web.alertDialog

Identifies an alert dialog box by its recorded ID and path.

web.assertErrors

Checks for exceptions.

web.assertText

Searches the HTML contents of all documents in all browser windows for the specified text pattern, reporting a failure if the test fails.

web.attribute

Constructs the property data of a single object attribute.

web.attributes

Constructs the object attributes.

web.button

Identifies a button by its recorded ID and path.

web.cell

Constructs the test data of a table cell.

web.cells

Constructs the list of table cell tests.

web.checkBox

Identifies a checkbox by its recorded ID and path.

web.clearAllCache

Clears all cache files.

web.clearAllPersistentCookies

Clears all persistent Cookies.

web.clearCache

Clears cache files by defined domain name.

web.clearPersistentCookies

Clears persistent Cookies by defined domain name.

web.clearSessionCookies

Clears session cookies in the current opened browser window.

web.confirmDialog

Identifies a confirmation dialog box by its recorded ID and path.

web.customElement

Identifies a custom DOM element by its recorded ID and path.

web.dialog

Identifies a dialog box by its path.

web.document

Identifies a window by its recorded ID and path.

web.element

Identifies an element by its recorded ID and path.

web.exists

Checks if an object exists or not with a specified timeout value.

web.getFocusedWindow

Gets the window with the focus.

web.image

Identifies an image by its recorded ID and path.

web.link

Identifies a link by its recorded ID and path.

web.loginDialog

Identifies a login dialog box by its recorded ID and path.

web.notificationBar

Identifies a notification bar by its path.

web.object

Identifies an object by its recorded ID and path.

web.promptDialog

Identifies a prompt dialog box by its recorded ID and path.

web.radioButton

Identifies a radio button by its recorded ID and path.

web.removeGlobalTextValidator

Removes a global text matching test (either assertion or verification).

web.selectBox

Identifies a select list box by its recorded ID and path.

web.solve

Searches the HTML contents of all documents in all browsers for the specified regular expression pattern.

web.table

Identifies a table by its recorded ID and path.

web.textArea

Identifies a text area by its recorded ID and path.

web.textBox

Identifies a text box by its recorded ID and path.

web.verifyText

Searches the HTML contents of all documents in all browser windows for the specified text pattern, reporting a warning if the test fails.

web.waitForObject

Waits for an object to exist before timing out.

web.window

Identifies a window by its recorded ID and path.

web.xmlDocument

Identifies an xml document by its recorded ID and path.


The following sections provide detailed reference information for each method and enum in the WebDomService Class of Web Functional Module Application Programming Interface.


web.accButton

Identifies an accessibility button by its path.

Format

The web.accButton method has the following command format(s):

web.accButton(path);

web.accButton(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccButton object using the specified path.

Example

Examples of actions on a button specified by its path.

//using script variable
getVariables().set("btnPath", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accPushButton[@index='1']");
web.accButton(1, "{{btnPath}}").click();
//using Java variable
String btnPath = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accPushButton[@index='1']";
web.accButton(10, btnPath).click();

web.accCheckBox

Identifies an accessibility checkbox by its path.

Format

The web.accCheckBox method has the following command format(s):

web.accCheckBox(path);

web.accCheckBox(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccCheckBox object using the specified path.

Example

Examples of actions on a checkbox specified by its recorded ID and path.

//using script variable
getVariables().set("cbpath", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accCheckButton[@index='0']");
web.accCheckBox(1, "{{cbpath}}").check(true);
//using Java variable
String cbpath = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accCheckButton[@index='0']";
web.accCheckBox(2, cbpath).check(false);

web.accComboBox

Identifies an accessibility combobox by its path.

Format

The web.accComboBox method has the following command format(s):

web.accComboBox(path);

web.accComboBox(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccComboBox object using the path.

Example

Examples of actions on the combobox specified by its recorded ID and path.

//using script variable
getVariables().set("combobox", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accComboBox[@index='0']");
web.accComboBox(101, "{{combobox}}").selectOptionByText("Bikes");
//using Java variable
String combobox = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accComboBox[@index='0']";
web.accComboBox((101, combobox).selectOptionByIndex(0);

web.accElement

Identifies an accessibility element by its recorded ID and path.

Format

The web.accElement method has the following command format(s):

web.accElement(path);

web.accElement(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccElement object using the specified recorded ID and path.

Example

Performs an action on an accessibility element specified by its recorded ID and path.

//using script variable
getVariables().set("elmPath", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='3']" +
 "/web:accClient[@index='0']");
web.accElement(56, "{{elmPath}}").mouseClick(260, 265);
//using Java variable
String elmPath = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='3']" +
 "/web:accClient[@index='0']";
web.accElement(56, elmPath).mouseClick(260, 265);

web.accListBox

Identifies an accessibility listbox by its path.

Format

The web.accListBox method has the following command format(s):

web.accListBox(path);

web.accListBox(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccListBox object using the specified path.

Example

Examples of actions on the list box specified by its recorded ID and path.

//using script variable
getVariables().set("listbox", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accList[@index='0']");
web.accListBox(101, "{{listbox}}").selectOptionByText("Bikes");
//using Java variable
String listbox = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accList[@index='0']";
web.accListBox(101, listbox).selectOptionByIndex(0);

web.accMenu

Identifies an accessibility menu by its path.

Format

The web.accMenu method has the following command format(s):

web.accMenu(path);

web.accMenu(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccMenu object using the specified path.

Example

Examples of actions on an accessibility menu specified by its recorded ID and path.

//using script variable
getVariables().set("menu", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accMenu[@index='0']");
web.accMenu(101, "{{menu}}").selectNode("File->Open");
//using Java variable
String menu = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accMenu[@index='0']";
web.accMenu(101, menu).selectNode("File->Open");

web.accRadioButton

Identifies an accessibility radio button by its path.

Format

The web.accRadioButton method has the following command format(s):

web.accRadioButton(path);

web.accRadioButton(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccRadioButton object using the specified path.

Example

Performs an action on a radio button specified by its recorded ID and path.

//using script variable
getVariables().set("radioBtn", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accRadioButton[@index='0' " +
   "or @name='Search Any']");
web.accRadioButton(96, "{{radioBtn}}").select();
//using Java variable
String radioBtn = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accRadioButton[@index='0' " +
   "or @name='Search Any']";
web.accRadioButton(96, radioBtn).select();

web.accTextBox

Identifies an accessibility text box by its path.

Format

The web.accTextBox method has the following command format(s):

web.accTextBox(path);

web.accTextBox(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

an AccTextBox object using the specified recorded ID and path.

Example

Clicks on a text box specified by its recorded ID and path and sets the text in the text box.

//using script variable
getVariables().set("tbPath", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accText[@index='0']");
web.accTextBox(10, "{{tbPath}}").setText("text box text");
//using Java variable
String tbPath = "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='0']" +
 "/web:accText[@index='1']";
web.accTextBox(10, tbPath).setText("text box text");

web.addGlobalAssertText

Registers a text matching (assertion) test to run every time a page is requested.

The text matching (assertion) test searches the HTML contents of all documents in all browser windows for the specified text pattern. If the test fails, the script will always fail and stop running, unless the text matching test error recovery setting specifies a different action such as Warn or Ignore.

The assertion is performed for all requests made by this virtual user.

This method supports result code verification methods including getLastResult() and getLastError().

To unregister a global text assertion, use web.removeGlobalTextValidator.

Format

The web.addGlobalAssertText method has the following command format(s):

web.addGlobalAssertText(testName, textToAssert, sourceType, textPresence, matchOption);

Command Parameters

testName

A string specifying a descriptive name of the test being applied. This name may be used by a subsequent call to web.removeGlobalTextValidator. Must not be null.

textToAssert

a String specifying the text to match on the page, or not match on the page if TextPresence is TextPresence.PassIfPresent. Must not be null.

sourceType

a Source enum specifying the location to match the text either in the HTML contents or HTTP response headers. Must not be null.

textPresence

TextPresence enum specifying Either PassIfPresent or FailIfPresent, depending on if you want the text to be present or not.

matchOption

a MatchOption enum specifying either Exact, RegEx, or Wildcard, depending on match type.

Example

Adds a Global Text Matching test for Display Content, Response Header, and Source HTML respectively.

globalTextMatchingTest1 passes if the text to match string is present in the Display Content and matches exactly.

globalTextMatchingTest2 passes if the text to match string is present in the Response header and matches the Regular Expression.

globalTextMatchingTest3 fails if the text to match string is present in the Source HTML and matches the Wildcard.

web.addGlobalAssertText("globalTextMatchingTest1",
 "match this text string", Source.DisplayContent,
 TextPresence.PassIfPresent, MatchOption.Exact);
web.addGlobalAssertText("globalTextMatchingTest2",
 "jsessionid=(.+?)(?:\\\"|&)", Source.ResponseHeader,
 TextPresence.PassIfPresent, MatchOption.RegEx);
web.addGlobalAssertText("globalTextMatchingTest3",
 "match this *", Source.Html, TextPresence.FailIfPresent,
 MatchOption.Wildcard);

web.addGlobalVerifyText

Registers a text matching (verification) test to run every time a page is requested.

The text matching (verification) test searches the HTML contents of all documents in all browser windows for the specified text pattern. If the test fails, a warning is always reported, irrespective of current Error Recovery settings.

The verification is performed for all requests made by this virtual user.

This method supports result code verification methods including getLastResult() and getLastError().

To unregister a global text verification, use web.removeGlobalTextValidator.

Format

The web.addGlobalVerifyText method has the following command format(s):

web.addGlobalVerifyText(testName, textToAssert, sourceType, textPresence, matchOption);

Command Parameters

testName

a String specifying the descriptive name of the test being applied. This name may be used by a subsequent call to web.removeGlobalTextValidator. Must not be null.

textToAssert

a String specifying the text to match on the page, or not match on the page if TextPresence says TextPresence.PassIfPresent. Must not be null.

sourceType

a Source enum specifying where to match the text either in the HTML contents or HTTP response headers. Must not be null.

textPresence

a TextPresence enum specifying either PassIfPresent or FailIfPresent, depending on if you want the text to be present or not.

matchOption

a MatchOption enum specifying either Exact, RegEx, or Wildcard, depending on match type.

Example

Adds a Global Text Matching test for Display Content, Response Header, and Source HTML respectively.

globalTextMatchingTest1 passes if the text to match string is present in the Display Content and matches exactly.

globalTextMatchingTest2 passes if the text to match string is present in the Response header and matches the Regular Expression.

globalTextMatchingTest3 fails if the text to match string is present in the Source HTML and matches the Wildcard.

web.addGlobalVerifyText("globalTextMatchingTest1",
 "match this text string", Source.DisplayContent,
 TextPresence.PassIfPresent, MatchOption.Exact);
web.addGlobalVerifyText("globalTextMatchingTest2",
 "jsessionid=(.+?)(?:\\\"|&)", Source.ResponseHeader,
 TextPresence.PassIfPresent, MatchOption.RegEx);
web.addGlobalVerifyText("globalTextMatchingTest3",
 "match this *", Source.Html, TextPresence.FailIfPresent,
 MatchOption.Wildcard);

web.alertDialog

Identifies an alert dialog box by its recorded ID and path.

Format

The web.alertDialog method has the following command format(s):

web.alertDialog(path);

web.alertDialog(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMAlertDialog object using the specified recorded ID and path.

Example

Performs an action on an alert dialog box specified by its recorded ID and path.

//using script variable
getVariables().set("dlgPath",
 "/web:dialog_alert[@text='ALERT!' and @index='0']");
web.alertDialog(1, "{{dlgPath}}").clickOk();
//using Java variable
String dlgPath = "/web:dialog_alert[@text='ALERT!' and @index='0']";
web.alertDialog(42, dlgPath).clickOk();

web.assertErrors

Checks for exceptions. Manually enter this method into a script to check if an exception occurred.

If there are exception in previous stepResult, just break the script.

Format

The web.assertErrors method has the following command format(s):

web.assertErrors( );

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Checks for exceptions. If there is an exception in the previous stepResult, cause a break in the script execution.

web.assertErrors();

web.assertText

Searches the HTML contents of all documents in all browser windows for the specified text pattern, reporting a failure if the test fails.

If the test fails, always fail the script unless the text matching test error recovery setting specifies a different action such as Warn or Ignore.

Format

The web.assertText method has the following command format(s):

web.assertText(testName, pattern, sourceType, textPresence, matchOption);

Command Parameters

testName

a String specifying the test name.

pattern

a String specifying the pattern of the test.

sourceType

a Source enum specifying the location to match, either the source HTML or the HTML excluding markup tags.

textPresence

a TextPresence enum specifying either PassIfPresent or FailIfPresent, depending on if you want the text to be present or not.

matchOption

a MatchOption enum specifying either Exact, RegEx, or Wildcard, depending on match type.

Throws

MatchException

if the assertion fails. AbstractScriptException on any other failure when attempting to assert the text.

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Adds Text Matching tests for Display Content and Raw HTML.

myTextMatchingTest1 passes if the text to match string is present in the Display Content and matches exactly.

myTextMatchingTest2 passes if the text to match string is present in the source HTML and matches the Regular Expression.

myTextMatchingTest3 fails if the text to match string is present in the source HTML and matches the Wildcard.

web.assertText("myTextMatchingTest1", "match this text string",
 Source.DisplayContent, TextPresence.PassIfPresent,
 MatchOption.Exact);
web.assertText("myTextMatchingTest2", "match(.+?)(?:\"|&)",
 Source.Html, TextPresence.PassIfPresent,
 MatchOption.RegEx);
web.assertText("myTextMatchingTest3", "match this *",
 Source.Html, TextPresence.FailIfPresent,
 MatchOption.Wildcard);

web.attribute

Constructs the property data of a single object attribute.

Format

The web.attribute method has the following command format(s):

web.attribute(property, expectedValue, operator);

Command Parameters

property

a String specifying the name of the property.

expectedValue

a String specifying the expected value of the property.

operator

TestOperator that defines the type and the match approach of the data.

Returns

a PropertyTest object with the specified property, expectedValue, operator

Example

Specifies each individual attribute of an Object Test.

getVariables().set("elmPath", "/web:window[@index='0' or @title='Mockups']" +
 "/web:document[@index='0']" +
 "/web:table[@id='toc' or @index='0']");
web.element(122,"{{elmPath}}").assertAttributes("MyObjectTest",
 web.attributes(web.attribute("tag", "TABLE", TestOperator.StringExact),
   web.attribute("id",   "toc", TestOperator.StringExact),
   web.attribute("className", "toc", TestOperator.StringExact),
   web.attribute("class", "toc", TestOperator.StringExact),
   web.attribute("summary", "Conts", TestOperator.StringExact),
   web.attribute("index", "0", TestOperator.StringExact)));

web.attributes

Constructs the object attributes.

Format

The web.attributes method has the following command format(s):

web.attributes(tests);

Command Parameters

tests

a list of attributes.

Returns

a PropertyTest[] with the specified attributes.

Example

Specifies the attibutes of an Object Test.

getVariables().set("elmPath", "/web:window[@index='0' or @title='Mockups']" +
 "/web:document[@index='0']" +
 "/web:table[@id='toc' or @index='0']");
web.element(122,"{{elmPath}}").assertAttributes("MyObjectTest",
 web.attributes(web.attribute("tag", "TABLE", TestOperator.StringExact),
   web.attribute("id", "toc", TestOperator.StringExact),
   web.attribute("className", "toc", TestOperator.StringExact),
   web.attribute("class", "toc", TestOperator.StringExact),
   web.attribute("summary", "Contents", TestOperator.StringExact),
   web.attribute("index", "0", TestOperator.StringExact)));

web.button

Identifies a button by its recorded ID and path.

Format

The web.button method has the following command format(s):

web.button(path);

web.button(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMButton object using the specified recorded ID and path.

Example

Examples of actions on a button specified by its recorded ID and path.

//using script variable
getVariables().set("btnPath", "/web:window[@index='0' " +
   "or @title='Stocks']" +
 "/web:document[@index='0']" +
 "/web:form[@id='loginform' or @name='loginform' " +
   "or @index='0']" +
 "/web:input_submit[@name='LoginButton' or @value='Login' " +
   "or @index='0']");
web.button(1, "{{btnPath}}").click();
web.button(2, "{{btnPath}}").mouseClick("<CTRL>", 1, false);
//using Java variable
String btnPath = "/web:window[@index='0' or @title='Stocks']" +
 "/web:document[@index='0'] " +
 "/web:form[@id='loginform' or @name='loginform' " +
   "or @index='0']" +
 "/web:input_submit[@name='LoginButton' or @value='Login' " +
   "or @index='0']";
web.button(1, btnPath).click();
web.button(2, btnPath).mouseClick("<CTRL>", 1, false);

web.cell

Constructs the test data of a table cell.

Format

The web.cell method has the following command format(s):

web.cell(row, column, expectedValue, operator);

Command Parameters

row

a 1-based index value specifying the row number.

column

a 1-based index value specifying the column number.

expectedValue

a String specifying the expected value of the property.

operator

a TestOperator enum that defines the type and the match approach of the data.

Returns

a CellTest object with the specified row, column, expectedValue, and operator.

Example

Adds a table test for specifying exact match or wildcard match for individual cells.

web.table(14,"/web:window[@title='Ticker List']" +
 "/web:document[@index='0']" +
 "/web:table[@index='6']")
 .assertCells("MyTableTest",
   web.cells(web.cell(1, 1, "Ticker ",TestOperator.StringExact),
     web.cell(1, 2,"Company ", TestOperator.StringExact),
     web.cell(2, 1, "ORCL*", TestOperator.StringWildCard),
     web.cell(2, 2, "Oracle", TestOperator.StringExact)));

web.cells

Constructs the list of table cell tests.

Format

The web.cells method has the following command format(s):

web.cells(tests);

Command Parameters

tests

a list of table cells.

Returns

a CellTest[] with the specified cells.

Example

Adds a table test for specifying exact match or wildcard match for each cell.

web.table(14,"/web:window[@title='Ticker List']" +
 "/web:document[@index='0']" +
 "/web:table[@index='6']")
 .assertCells("MyTableTest",
   web.cells(web.cell(1, 1, "Ticker ",TestOperator.StringExact),
     web.cell(1, 2,"Company ", TestOperator.StringExact),
     web.cell(2, 1, "ORCL*", TestOperator.StringWildCard),
     web.cell(2, 2, "Oracle", TestOperator.StringExact)));

web.checkBox

Identifies a checkbox by its recorded ID and path.

Format

The web.checkBox method has the following command format(s):

web.checkBox(path);

web.checkBox(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMCheckbox object using the specified recorded ID and path.

Example

Examples of actions on a checkbox specified by its recorded ID and path.

//using script variable
getVariables().set("cbpath", "/web:window[@index='0' " +
   "or @title='Chart Portfolio']" +
 "/web:document[@index='0']" +
 "/web:input_checkbox[@id='chkTrack' or @name='chkTrack' " +
   "or @index='0']");
web.checkBox(1, "{{cbpath}}").click();
web.checkBox(2, "{{cbpath}}").check(true);
web.checkBox(3, "{{cbpath}}").dblClick();
web.checkBox(4, "{{cbpath}}").mouseClick(1, 1, "<ALT>", 1,
 false, ClickPosition.Center);
web.checkBox(5, "{{cbpath}}").clickContextMenu("contextMenuItem", 0);
web.checkBox(6, "{{cbpath}}").keyPress("<SPACE>");
//using Java variable
String cbpath = "/web:window[@index='0' " +
   "or @title='Chart Portfolio']" +
 "/web:document[@index='0']" +
  "/web:input_checkbox[@id='chkTrack' or @name='chkTrack' " +
   "or @index='0']";
web.checkBox(1, cbpath).click();
web.checkBox(2, cbpath).check(true);
web.checkBox(3, cbpath).dblClick();
web.checkBox(4, cbpath).mouseClick(1, 1, "<ALT>", 1,
 false, ClickPosition.Center);
web.checkBox(5, cbpath).clickContextMenu("contextMenuItem", 0);
web.checkBox(6, cbpath).keyPress("<SPACE>");

web.clearAllCache

Clears all cache files.

Format

The web.clearAllCache method has the following command format(s):

web.clearAllCache( );

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Clears all Cache.

web.clearAllCache();

web.clearAllPersistentCookies

Clears all persistent Cookies.

Format

The web.clearAllPersistentCookies method has the following command format(s):

web.clearAllPersistentCookies( );

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Clears all Persistent Cookies.

web.clearAllPersistentCookies();

web.clearCache

Clears cache files by defined domain name.

Format

The web.clearCache method has the following command format(s):

web.clearCache(domainName);

Command Parameters

domainName

a String specifying the Domain name of the Web server.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Clears cache files by the specified domain name.

web.clearCache("domainName");

web.clearPersistentCookies

Clears persistent Cookies by defined domain name.

Format

The web.clearPersistentCookies method has the following command format(s):

web.clearPersistentCookies(domainName);

Command Parameters

domainName

a String specifying the Domain name of the Web server.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Clears Persistent Cookies by the specified domain name.

web.clearPersistentCookies("domainName");

web.clearSessionCookies

Clears session cookies in the current opened browser window.

Format

The web.clearSessionCookies method has the following command format(s):

web.clearSessionCookies( );

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Clears session cookies in the currently opened browser window.

web.clearSessionCookies();

web.confirmDialog

Identifies a confirmation dialog box by its recorded ID and path.

Format

The web.confirmDialog method has the following command format(s):

web.confirmDialog(path);

web.confirmDialog(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMConfirmDialog object using the specified recorded ID and path.

Example

Performs an action on a open JavaScript dialog box specified by its recorded ID and path.

//using script variable
getVariables().set("cfmDialog",
 "/web:dialog_confirm[@text='Continue? OK/Cancel' " +
   "and @index='0']");
web.confirmDialog(46, "{{cfmDialog}}").clickOk();
//using Java variable
String cfmDialog = "/web:dialog_confirm[@text='Continue? OK/Cancel' " +
   "and @index='0']";
web.confirmDialog(46, cfmDialog).clickCancel();

web.customElement

Identifies a custom DOM element by its recorded ID and path.

Format

The web.customElement method has the following command format(s):

web.customElement(path);

web.customElement(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a ICustomDOMElement object using the specified path.

Example

Performs an action on the custom element specified by its path.

getVariables().set("custElmPath", "/web:window[@index='0' " +
   "or @title='Mail Order']" +
 "/web:document[@index='0']" +
 "/web:web:element[@id='btnBikes' or @name='btnBikes' " +
   "or @index='0']");
web.customElement(12, "{{custElmPath}}").assertAttribute("myTest", "id",
 "btnBikes", TestOperator.StringExact);

web.dialog

Identifies a dialog box by its path.

Format

The web.dialog method has the following command format(s):

web.dialog(path);

web.dialog(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMDialog object using the specified path.

Example

Performs an action on an open dialog box specified by its recorded ID and path.

//using script variable
getVariables().set("dlgPath",
 "/web:dialog_unknown[@text='an input box' and @index='0']");
web.dialog(1, "{{dlgPath}}").setText(0, "text input");
web.dialog(2, "{{dlgPath}}").clickButton(0);
//using Java variable
String dlgPath = "/web:dialog_unknown[@text='an input box' and @index='0']";
web.dialog(1, dlgPath).setText(0, "text input");
web.dialog(2, dlgPath).clickButton(0);

web.document

Identifies a window by its recorded ID and path.

Format

The web.document method has the following command format(s):

web.document(path);

web.document(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMDocument object using the specified recorded ID and path.

Example

Performs an action on an open web document specified by its recorded ID and path.

getVariables().set("recHtml", web.document(1,
 "/web:document[@index='0]'").getHTML());
info("The HTML string is: {{recHtml}}");
getVariables().set("recUrl", web.document(2,
 "/web:document[@index='0]'").getRecordedURL());
info("The URL is: {{recUrl}}");

web.element

Identifies an element by its recorded ID and path.

Format

The web.element method has the following command format(s):

web.element(path);

web.element(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMElement object using the specified recorded ID and path.

Example

Performs an action on an open VB Script dialog box specified by its recorded ID and path.

//using script variable
getVariables().set("elmPath", "/web:window[@index='1' " +
   "or @title='VBScript Form']" +
 "/web:document[@index='0']" +
 "/web:table[@index='0']");
web.element(56, "{{elmPath}}").click();
//using Java variable
String elmPath1 = "/web:window[@index='1' " +
   "or @title='VBScript Form']" +
 "/web:document[@index='0']" +
 "/web:table[@index='0']";
web.element(56, elmPath).click();

web.exists

Checks if an object exists or not with a specified timeout value.

Format

The web.exists method has the following command format(s):

web.exists(path);

web.exists(path, timeout);

Command Parameters

path

a String specifying the object path.

timeout

a timeout value to find an object, in seconds.

Returns

return true if the object exists, otherwise return false.

Example

Checks if the specified object exists or not. Timeout after 10 seconds.

Boolean doesExist = web.exists("/web:document[@index='0]'", 10);
if (doesExist = true) {
 info("document exists");
}

web.getFocusedWindow

Gets the window with the focus.

Format

The web.getFocusedWindow method has the following command format(s):

web.getFocusedWindow( );

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMBrowser object.

Example

Gets the title of the window that has the focus.

//using script variable
getVariables().set("winTitle", web.getFocusedWindow().getTitle());
info("Script: Title is {{winTitle}}");
//using Java variable
String winTitle = web.getFocusedWindow().getTitle();
info("Java: Title is " + winTitle);

web.image

Identifies an image by its recorded ID and path.

Format

The web.image method has the following command format(s):

web.image(path);

web.image(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMImage object using the specified recorded ID and path.

Example

Examples of actions on an image specified by its recorded ID and path.

//using script variable
getVariables().set("imgPath", "/web:window[@index='0' " +
   "or @title='Mail Order']" +
 "/web:document[@index='0']" +
 "/web:input_image[@id='btnBikes' or @name='btnBikes' " +
   "or @src='http://testserver2/images/bikes.jpg' " +
   "or @index='0']");
web.image(82, "{{imgPath}}").click();
//using Java variable
String imgPath = "/web:window[@index='0' or @title='Mail Order']" +
 "/web:document[@index='0']" +
 "/web:input_image[@id='btnBikes' or @name='btnBikes' " +
   "or @src='http://testserver2/images/bikes.jpg' " +
   "or @index='0']";
web.image(82, imgPath).click();

web.link

Identifies a link by its recorded ID and path.

Format

The web.link method has the following command format(s):

web.link(path);

web.link(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMLink object using the specified recorded ID and path.

Example

Examples of actions on the link specified by its recorded ID and path.

//using script variable
getVariables().set("lnkPath", "/web:window[@index='0' " +
   "or @title=' Bikes']" +
 "/web:document[@index='0']" +
 "/web:a[@text='Mail Order Bikes' " +
   "or @href='http://testserver2/bikes/Main.aspx' " +
   "or @index='5']");
web.link(60, "{{lnkPath}}").click();
//using Java variable
String lnkPath = "/web:window[@index='0' or @title=' Bikes']" +
 "/web:document[@index='0']" +
 "/web:a[@text='Mail Order Bikes' " +
   "or @href='http://testserver2/bikes/Main.aspx' " +
   "or @index='5']";
web.link(60, lnkPath).click();

web.loginDialog

Identifies a login dialog box by its recorded ID and path.

Format

The web.loginDialog method has the following command format(s):

web.loginDialog(path);

web.loginDialog(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMLoginDialog object using the specified recorded ID and path.

Example

Performs an action on the login dialog box specified by its recorded ID and path.

getVariables().set("dlgPath", "/web:dialog_unknown[@text='Login!' " +
   "and @index='0']");
//Click OK with username and password. Remember password true.
web.loginDialog(10, "{{dlgPath}}").clickOk("username",
   decrypt("vGXUWvDW/F7E6OSYUjRmsQ=="), true);
//Click Cancel
web.loginDialog(15, "{{dlgPath}}").clickCancel();

web.notificationBar

Identifies a notification bar by its path.

Format

The web.notificationBar method has the following command format(s):

web.notificationBar(path);

web.notificationBar(recId, path);

Command Parameters

recId

the ID of a previously recorded navigation, used for comparison purposes.

path

a String specifying the object path.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMNotificationBar object using the specified path.

Example

Performs an action on a notification bar specified by its recorded ID and path.

//using script variable
getVariables().set("notiBarPath",
 "/web:window[@index='0' or @title='Download Portfolio']");
web.notificationBar("{{notiBarPath}}").selectOptionBy(3, 1);
web.notificationBar("{{notiBarPath}}").clickButton(2);
//using Java variable
String notiBarPath = "/web:window[@index='0' or @title='Download Portfolio']";
web.notificationBar(notiBarPath).selectOptionBy(3, 1);
web.notificationBar(notiBarPath).clickButton(2);

web.object

fies an object by its recorded ID an

Format

The web.object method has the following command format(s):

web.object(path);

web.object(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMObject object using the specified recorded ID and path.

Example

Performs an action on the object specified by its recorded ID and path.

getVariables().set("objPath", "/web:window[@index='0']" +
 "/web:document[@index='0']" +
 "/web:object[@index='3']");
web.object(14, "{{objPath}}").click();

web.promptDialog

Identifies a prompt dialog box by its recorded ID and path.

Format

The web.promptDialog method has the following command format(s):

web.promptDialog(path);

web.promptDialog(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMPromptDialog object using the specified recorded ID and path.

Example

Performs an action on the prompt dialog box specified by its recorded ID and path.

//using script variable
getVariables().set("dlgPropmt", "/web:dialog_prompt[@text='Script Prompt:' " +
   "and @index='0']");
web.promptDialog(90, "{{dlgPropmt}}").clickOk("input text");
//using Java variable
String dlgPropmt = "/web:dialog_prompt[@text='Script Prompt:' and @index='0']";
web.promptDialog(90, dlgPropmt).clickOk("input text");

web.radioButton

Identifies a radio button by its recorded ID and path.

Format

The web.radioButton method has the following command format(s):

web.radioButton(path);

web.radioButton(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMRadioButton object using the specified recorded ID and path.

Example

Performs an action on a radio button specified by its recorded ID and path.

//using script variable
getVariables().set("radioBtn", "/web:window[@index='0' or @title='Sell']" +
 "/web:document[@index='0']" +
 "/web:form[@index='0']" +
 "/web:input_radio[@id='symbol3' " +
   "or (@name='symbol' and @value='ORCL') or @index='2']");
Boolean isSelected = web.radioButton(96, "{{radioBtn}}")
   .isSelected();
if (isSelected = false) {
 info("radio button not selected");
web.radioButton(96, "{{radioBtn}}").select();
}
//using Java variable
String radioBtn = "/web:window[@index='0' or @title='Sell']" +
 "/web:document[@index='0']/web:form[@index='0']" +
 "/web:input_radio[@id='symbol3'" +
   "or (@name='symbol' and @value='ORCL') or @index='2']");
Boolean isSelected = web.radioButton(96, "{{radioBtn}}")
   .isSelected();
if (isSelected = false) {
 info("radio button not selected");
web.radioButton(96, radioBtn).select();
}

web.removeGlobalTextValidator

Removes a global text matching test (either assertion or verification).

This method removes text matching tests that were previously added using web.addGlobalAssertText or web.addGlobalVerifyText.

If the specified test was not previously added, this method does nothing. No error is thrown.

Format

The web.removeGlobalTextValidator method has the following command format(s):

web.removeGlobalTextValidator(testName);

Command Parameters

testName

a String specifying the name of the test previously addedusing web.addGlobalAssertTextor web.addGlobalVerifyText.

Returns

true if the test was removed, false if no test removed.

Example

Removes the Global Text Matching test added as "globalTextMatchingTest1".

web.removeGlobalTextValidator("globalTextMatchingTest1");

web.selectBox

Identifies a select list box by its recorded ID and path.

Format

The web.selectBox method has the following command format(s):

web.selectBox(path);

web.selectBox(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMSelect object using the specified recorded ID and path.

Example

Examples of actions on the select list box specified by its recorded ID and path.

//using script variable
getVariables().set("selectList", "/web:window[@index='0'" +
   "or @title='downhill bikes home']" +
 "/web:document[@index='0']" +
 "/web:form[@id='Default' or @name='Default' or @index='0']" +
 "/web:select[(@id='lstCatalogCategory' or @name='lstCatalogCategory'" +
   ""or @index='0') and multiple mod 'False']");
web.selectBox(1, "{{selectList}}").selectOptionByText("Bikes");
//using Java variable
String selectList = "/web:window[@index='0'" +
   "or @title='downhill bikes home']" +
 "/web:document[@index='0']" +
 "/web:form[@id='Default' or @name='Default' or @index='0']" +
 "/web:select[(@id='lstCatalogCategory' or @name='lstCatalogCategory'" +
   "or @index='0') and multiple mod 'False']";
web.selectBox(1, selectList).selectOptionByText("Bikes");
//multiple list select using script variable
getVariables().set("selectList", "/web:window[@index='0' " +
   "or @title='downhill bikes home']" +
 "/web:document[@index='0']" +
 "/web:form[@id='Default' or @name='Default' or @index='0']" +
 "/web:select[(@id='lstCatalogCategory' or @name='lstCatalogCategory'" +
   "or @index='0') and multiple mod 'True']");
web.selectBox(1, "{{selectList}}").multiSelectOptionByText("Bikes", "Parts");

web.solve

Searches the HTML contents of all documents in all browsers for the specified regular expression pattern.

Found results are stored in the variable named varName. If no results are found, and error recovery settings specify that WEBDOM_SOLVE_ERROR should fail, then this method throws a SolveException.

Format

The web.solve method has the following command format(s):

web.solve(varName, pattern, sourceType, resultIndex);

Command Parameters

varName

a String specifying the name of the variable to create.

pattern

a String specifying the Regular Expression pattern specifying what to extract from each document's HTML contents.

sourceType

a Source emun specifying the location to match, either the raw HTML or the HTML excluding markup tags.

resultIndex

a value specifying which value to match if the pattern matches more than 1 value. Specify the 0-based index of the specific result to retrieve. If null is specified, all results will be added into the variables collection.For example, the first result found is stored in varName,the second is stored in varName[1], the third in varName[2], [...]

Throws

AbstractScriptException

If no results are found, and error recovery settings specifythat WEBDOM_SOLVE_ERROR should fail, then this method throws a SolveException.

Example

Parse a value from the most recent navigation's specified source using a Regular Expression and store it in a variable. Includes a result index value of 0 to specify it should retrieve the first match result.

web.solve("varTitle", "<TITLE>(.+)</TITLE>", Source.Html, 0);
info("Page Title = {{varTitle}}");

web.table

Identifies a table by its recorded ID and path.

Format

The web.table method has the following command format(s):

web.table(path);

web.table(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMTable object using the specified recorded ID and path.

Example

Performs an action on the table specified by its recorded ID and path.

getVariables().set("tblPath", "/web:window[@index='0' " +
   "or @title='Ticker List']" +
 "/web:document[@index='0']" +
 "/web:table[@index='6']");
web.table(14, "{{tblPath}}").assertCells("MyTableTest",
 web.cells(web.cell(1, 1, "Ticker ",TestOperator.StringExact),
   web.cell(1, 2,"Company ", TestOperator.StringExact),
   web.cell(2, 1, "ORCL*", TestOperator.StringWildCard),
   web.cell(2, 2, "Oracle", TestOperator.StringExact)));

web.textArea

Identifies a text area by its recorded ID and path.

Format

The web.textArea method has the following command format(s):

web.textArea(path);

web.textArea(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMTextArea object using the specified recorded ID and path.

Example

Clicks on a text area specified by its recorded ID and path and sets the text in the text area.

getVariables().set("taPath", "/web:window[@index='0' " +
   "or @title='Input Samples']" +
 "/web:document[@index='0']" +
 "/web:textarea[@name='myTextArea' or @index='0']");
web.textArea(84, "{{taPath}}").click()
web.textArea(85, "{{taPath}}").setText("text area text");

web.textBox

Identifies a text box by its recorded ID and path.

Format

The web.textBox method has the following command format(s):

web.textBox(path);

web.textBox(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMText object using the specified recorded ID and path.

Example

Clicks on a text box specified by its recorded ID and path and sets the text in the text box.

//plain text box
getVariables().set("tbPath", "/web:window[@index='0' " +
   "or @title='Stocks']" +
 "/web:document[@index='0']" +
 "/web:form[@id='loginform' or @name='loginform' " +
   "or @index='0']" +
 "/web:input_text[@id='login' or @name='login' " +
   "or @index='0']");
web.textBox(9,"{{tbPath}}").click();
web.textBox(10, "{{tbPath}}").setText("text box text");
//password box
getVariables().set("tbPath", "/web:window[@index='0' " +
   "or @title='Stocks']" +
 "/web:document[@index='0']" +
 "/web:form[@id='loginform' or @name='loginform' " +
   "or @index='0']" +
 "/web:input_password[@name='password' or @index='0']");
web.textBox(11, "{{tbPath}}").click();
web.textBox(12, "{{tbPath}}").setPassword(deobfuscate("wKAUCoeFpUbXlwTYN9lp7A=="));

web.verifyText

Searches the HTML contents of all documents in all browser windows for the specified text pattern, reporting a warning if the test fails.

This method will never cause a script to fail, regardless of the text matching test error recovery settings. Use web.assertText to make the script fail when the test fails.

Format

The web.verifyText method has the following command format(s):

web.verifyText(testName, pattern, sourceType, textPresence, matchOption);

Command Parameters

testName

a String specifying the test name.

pattern

a String specifying the pattern of test.

sourceType

a Source enum specifying the location to match, either the source HTML or the HTML excluding markup tags.

textPresence

a TextPresence enum specifying either PassIfPresent or FailIfPresent, depending on if you want the text to be present or not.

matchOption

a MatchOption enum specifying either Exact, RegEx, or Wildcard, depending on match type.

Throws

AbstractScriptException

on any failure when attempting to verify the text.

Example

Adds a Verify only, never fail Text Matching tests for Display Content and Raw HTML respectively.

myTextMatchingTest1 passes if the text to match string is present in the Display Content and matches exactly.

myTextMatchingTest2 fails if the text to match string is present in the source HTML and matches the Wildcard.

web.verifyText("myTextMatchingTest1", "FMStocks Customer Login",
 Source.DisplayContent, TextPresence.PassIfPresent,
 MatchOption.Exact);
web.verifyText("myTextMatchingTest2", "FMStocks Customer Log*",
 Source.Html, TextPresence.FailIfPresent,
 MatchOption.Wildcard);

web.waitForObject

Waits for an object to exist before timing out.

Format

The web.waitForObject method has the following command format(s):

web.waitForObject(path, timeout);

Command Parameters

path

a String specifying the object path.

timeout

a timeout value to find an object, in milliseconds.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Waits for the object specified by its path. Timeout after 5 seconds.

getVariables().set("obPath", "/web:window[@index='1']" +
 "/web:document[@index='1']" +
 "/web:form[@id='loginform' or @name='loginform' or @index='0']" +
 "/web:input_submit[@name='LoginButtonADD']");
web.waitForObject("{{obPath}}", 5000);

web.window

Identifies a window by its recorded ID and path.

Format

The web.window method has the following command format(s):

web.window(path);

web.window(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMBrowser object using the specified recorded ID and path.

Example

Navigates to and waits for the window specified by its recorded ID and path.

web.window(2, "/web:window[@index='0' or @title='about:blank']")
   .navigate("http://testserver2.com/fmstocks");
web.window(4, "/web:window[@index='0' or @title='Stocks']")
   .waitForPage(null);

web.xmlDocument

Identifies an xml document by its recorded ID and path.

Format

The web.xmlDocument method has the following command format(s):

web.xmlDocument(path);

web.xmlDocument(recId, path);

Command Parameters

path

a String specifying the object path.

recId

the ID of a previously recorded navigation, used for comparison purposes.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Returns

a DOMDocument object using the specified recorded ID and path.

Example

Performs an action on an open xml document specified by its recorded ID and path.

getVariables().set("recHtml", web.xmlDocument(1,
 "/web:document[@index='0]'").getHTML());
info("The HTML string is: {{recHtml}}");
getVariables().set("recUrl", web.xmlDocument(2,
 "/web:document[@index='0]'").getRecordedURL());
info("The URL is: {{recUrl}}");