web

Provides methods for browser automation.

Notes:
Commands which operate on elements such as click, assert, waitFor, type, select, and others will automatically wait for a period of time for the element to appear in DOM and become visible. By default this period equals to 60 seconds, but can be changed using the setTimeoutcommand.

Commands which expect a string matching pattern in their arguments, support following patterns unless specified otherwise:
  • regex:PATTERN - Match using regular expression.
  • regexi:PATTERN - Match using case-insensitive regular expression.
  • exact:STRING - Match the string verbatim.
  • glob:PATTERN - Match using case-insensitive glob pattern. ? will match any single character except new line (\n). * will match any sequence (0 or more) of characters except new line. Empty PATTERN will match only other empty strings.
  • PATTERN - Same as glob matching.

Commands which expect an element locator in their arguments, support following locator types unless specified otherwise:
  • id=ID - Locates element by its ID attribute.
  • css=CSS_SELECTOR - Locates element using a CSS selector.
  • link=TEXT - Locates link element whose visible text matches the given string.
  • link-contains=TEXT - Locates link element whose visible text contains the given string.
  • name=NAME - Locates element by its NAME attribute.
  • /XPATH - Locates element using an XPath 1.0 expression.
  • (XPATH)[] - Locates element using an XPath 1.0 expression.

Methods

getCaps()→ {Object}

Returns currently defined capabilities.

Returns:
Object - capabilities - Current capabilities object.

init(caps, seleniumUrl)

Initializes new Selenium session.

Parameters:
Name Type Description
caps String= optionalDesired capabilities. If not specified capabilities will be taken from suite definition.
seleniumUrl String= optionalRemote server URL (default: http://localhost:4444/wd/hub).

transaction(name)

Opens new transaction.

The transaction will persist till a new one is opened. Transaction names must be unique.

Parameters:
Name Type Description
name String The transaction name.

dispose()

Ends the current session.

alertAccept()

Accepts an alert or a confirmation dialog.

In case of an alert box this command is identical to alertDismiss.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.click("id=SaveButton");//Clicks on save – an alert would pop up 
web.alertAccept();//Clicks on "OK" in the alert dialog.

alertDismiss()

Dismisses an alert or a confirmation dialog.

In case of an alert box this command is identical to alertAccept.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.click("id=SaveButton");//Clicks on save – an alert would pop up 
web.alertDismiss();//Clicks on Cancel in the alert dialog.

assertAlert(pattern, timeout)

Asserts whether alert matches the specified pattern and dismisses it.

Text pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.click("id=SaveButton");//Clicks on save – an alert would pop up 
web.assertAlert ("title=Your Alert");//Asserts the title in the alert dialog.
Parameters:
Name Type Description
pattern String Text pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertExist(locator, timeout)

Asserts whether element exists in the DOM.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertExist ("id=Username");// Asserts if an element exists in the DOM.
Parameters:
Name Type Description
locator String An element locator.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertSelectedLabel(locator, pattern, timeout)

Asserts text of the currently selected option in a drop-down list.

Assertion pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertSelectedLabel ("id=Selection","label=United States");// Asserts if an element's label is selected in the drop down list.
Parameters:
Name Type Description
locator String An element locator.
pattern String The assertion pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertSelectedValue(locator, pattern, timeout)

Asserts value of the currently selected option in a drop-down list.

Assertion pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertSelectedValue ("id=Selection","value=3");// Asserts if an element's value is selected in the drop down list.
Parameters:
Name Type Description
locator String An element locator.
pattern String The assertion pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertText(locator, pattern, timeout)

Waits for inner text of the given element to match the specified pattern.

Text pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertText ("id=UserName","John Doe");// Asserts if an element's text is as expected.
Parameters:
Name Type Description
locator String An element locator.
pattern String Text pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertTextNotPresent(text, timeout)

Asserts whether the given text is not present on the page. That is, whether there are no elements containing this text on the page.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertTextNotPresent ("John Doe");// Asserts if a text is not presented somewhere on the page.
Parameters:
Name Type Description
text String Text.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertTextPresent(text, timeout)

Asserts whether the given text is present somewhere on the page. That is whether an element containing this text exists on the page.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertTextPresent ("John Doe");// Asserts if a text is presented somewhere on the page.
Parameters:
Name Type Description
text String Text.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertTitle(pattern, timeout)

Asserts the page title.

Assertion pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertTitle ("title=Your websites title!");// Asserts if the title of the page.
Parameters:
Name Type Description
pattern String The assertion pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

assertValue(locator, pattern, timeout)

Asserts element's value.

Value pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session
web.open("www.yourwebsite.com");// Opens a website.
web.assertValue("id=UserName", "value=John Doe");// Asserts if the value of an element.
Parameters:
Name Type Description
locator String An element locator.
pattern String Value pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

back()

Navigate backwards in the browser history.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.click("id=NextPage");//Clicks on next page link.
web.back();//Navigate back to previous page.

clear(locator)

Clear the value of an input field.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.type("id=Password", "Password");//Types a password to a field.
web.clear("id=Password");//Clears the characters from the field of an element.
Parameters:
Name Type Description
locator String An element locator.

click(locator)

Clicks on an element.

If the click causes new page to load, the command waits for page to load before proceeding.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.click("id=NextPage");//Clicks on next page link.
Parameters:
Name Type Description
locator String An element locator.

clickHidden(locator)

Clicks on a non-visible element.

If the click causes new page to load, the command waits for page to load before proceeding.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.clickHidden("id=HiddenLink");//Clicks on a hidden / invisible element.
Parameters:
Name Type Description
locator String An element locator.

closeWindow()

Closes the currently active window.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.closeWindow();//Closes the current window.

deselect(selectLocator, optionLocator)

Deselects an option from multiple-choice drop-down list.

Option locator can be one of the following (No prefix is same as label matching):

  • label=STRING Matches option based on the visible text.
  • value=STRING Matches option based on its value.
  • index=STRING Matches option based on its index. The index is 0-based.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.deselect("id=Selection","label=United States");//Deselect option from multiple choice drop down list.
Parameters:
Name Type Description
selectLocator String An element locator identifying a drop-down menu.
optionLocator String An option locator.

doubleClick(locator)

Double clicks on an element.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.doubleClick("id=Mark");//Double clicks on a element.
Parameters:
Name Type Description
locator String An element locator.

dragAndDrop(srcElement, dstElement)

Drag and Drop element into another element


Usage example. Drops grey rectangle into red square.

web.init();
web.open('http://webdriverjs.christian-bromann.com/');
web.dragAndDrop('id=overlay', '/html/body/section/div[1]');
web.pause(10*1000);
Parameters:
Name Type Description
srcElement String Element to drag and drop.
dstElement String Destination element to drop into.

execute(script, arg)→ {Object}

Executes JavaScript in the context of the currently selected frame or window.

If return value is null or there is no return value, null is returned.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web. execute (function() 
{
angular.element(".password").trigger("ng-click").click()
}
);//Executes/injects JavaScript code.
Parameters:
Name Type Description
script (String|Function) The JavaScript to execute.
arg ...Object optionalOptional script arguments.
Returns:
Object - The return value.

fileBrowse(locator, filepath)

Uploads a local file.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.fileBrowse("id=ProfilePicture","C:/ProgramFiles/picture.jpg");//Uploads a file to an element.
Parameters:
Name Type Description
locator String Locator for a `input type=file` element.
filepath String Path to a local file.

getAlertText()→ {String}

Gets the text displayed by an alert or confirm dialog.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getAlertText();//Gets the text in the alert dialog.
Returns:
String - The alert's text.

getAttribute(locator, attribute)→ {String}

Returns the element's attribute.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getAttribute("id=UserName","value");//Gets an attribute from an element.
Parameters:
Name Type Description
locator String An element locator.
attribute String The name of the attribute to retrieve.
Returns:
String - The attribute's value.

getBrowserLogs()→ {String}

Collects logs from the browser console.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getBrowserLogs(); //Collects logs from the browser console
Returns:
String - A list of logs.

getCssValue(locator, propertyName)→ {String}

Returns the value of a CSS property of an element.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getCssValue("id=UserName","color");//Gets a CSS value from an element.
Parameters:
Name Type Description
locator String An element locator.
propertyName String CSS property name.
Returns:
String - CSS property value.

getElementCount(locator)→ {Number}

Retrieves the count of elements matching the given locator.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getElementCount("//*[@class=Title]");//Gets the amount of elements.
Parameters:
Name Type Description
locator String Element locator.
Returns:
Number - Element count or 0 if no elements were found.

getSource()→ {String}

Gets the source of the currently active window.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getSource();//Gets the source of the page.
Returns:
String - The page source.

getText(locator)→ {String}

Returns the text (rendered text shown to the user) of an element.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getText("id=Title");//Gets the text from an element.
Parameters:
Name Type Description
locator String An element locator.
Returns:
String - The element's text.

getTitle()→ {String}

Returns the title of the currently active window.

Returns:
String - The page title.

getUrl()→ {String}

Gets the URL of the currently active window.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getUrl();//Gets the url from the current page.
Returns:
String - The page URL.

getValue(locator)→ {String}

Returns the (whitespace-trimmed) value of an input field. For checkbox/radio elements, the value will be "on" or "off".


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getValue("id=UserName");//Gets the value from an element.
Parameters:
Name Type Description
locator String An element locator.
Returns:
String - The value.

getWindowHandles()→ {Array.<String>}

Gets handles of currently open windows.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getWindowHandles();//Gets the window handles of currently open windows.
Returns:
Array.<String> - Array of all available window handles.

getXMLPageSource()→ {String}

Gets the source of the currently active window which displays text/xml page.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.getXMLPageSource();//Gets the source of currently open page which displays in text/xml.
Returns:
String - The XML page source.

isAlertPresent()→ {Boolean}

Return true if alert dialog is currently present on the screen.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.isAlertPresent ();//Returns true if  the alert dialog is displayed.
Returns:
Boolean - True if alert is present, false otherwise.

isExist(locator, timeout)→ {Boolean}

Checks if element is present in the DOM. Returns false if element was not found within the specified timeout.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.isExist("id=SaveButton");// Returns true if  the element exists in page.
Parameters:
Name Type Description
locator String An element locator.
timeout Number= optionalTimeout in milliseconds to wait for element to appear. Default is 60 seconds.
Returns:
Boolean - True if element was found. False otherwise.

isVisible(locator, timeout)→ {Boolean}

Checks if element is present and visible. Returns false if element was not found or wasn't visible within the specified timeout.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.isVisible("id=SaveButton");// Returns true if  the element is displayed in page.
Parameters:
Name Type Description
locator String An element locator.
timeout Number= optionalTimeout in milliseconds to wait for element to appear. Default is 60 seconds.
Returns:
Boolean - True if element was found and it was visible. False otherwise.

makeVisible(locator)

Makes hidden element visible.

This a workaround command for situations which require manipulation of hidden elements, such as when using web.type command for file input fields which tend to be hidden.
Specifically makeVisible will apply following styles to the specified element:

  • visibility = 'visible'
  • height = '1px'
  • width = '1px'
  • opacity = 1
  • display='block'


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.makeVisible("id=SaveButton");// Makes an invisible/hidden element to become visible.
Parameters:
Name Type Description
locator String An element locator. If multiple elements match the locator, visibility is applied to all.

open(url)

Opens an URL.

The open command waits for the page to load before proceeding.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
Parameters:
Name Type Description
url String The URL to open; may be relative or absolute.

pause(ms)

Pauses test execution for given amount of milliseconds.


Usage example

web.init();//Opens browser session.
web.pause(10000);//Waits amount of milliseconds untill the next command executes
Parameters:
Name Type Description
ms Number milliseconds to pause the execution.

point(locator, xoffset, yoffset)

Points the mouse cursor over the specified element.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.point("id=Selection");//Hovers a mouse over an element.
Parameters:
Name Type Description
locator String An element locator.
xoffset Number= optionalX offset from the element.
yoffset Number= optionalY offset from the element.

refresh()

Causes the browser to reload the page.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.refresh();//Reloads the page

scrollToElement(locator, xoffset, yoffset)

Scrolls the page to the location of the specified element.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.scrollToElement("id=Button");// Scrolls to an element.
Parameters:
Name Type Description
locator String An element locator.
xoffset Number X offset from the element. Can be either a positive or negative value.
yoffset Number Y offset from the element. Can be either a positive or negative value.

select(selectLocator, optionLocator)

Selects an option from a drop-down list using an option locator. This command works with multiple-choice lists as well.

Option locator can be one of the following (No prefix is same as label matching):

  • label=STRING - Matches option based on the visible text.
  • value=STRING - Matches option based on its value.
  • index=STRING - Matches option based on its index. The index is 0-based.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.select("id=Selection","label=United States");// Selects an element from a list.
Parameters:
Name Type Description
selectLocator String An element locator identifying a drop-down menu.
optionLocator String An option locator.

selectFrame(frameLocator)

Selects a frame or an iframe within the current window.

Available frame locators:

  • 'parent' - Select parent frame.
  • 'top' - Select top window.
  • NUMBER - Select frame by its 0-based index.
  • LOCATOR - Locator identifying the frame (relative to the top window). Multiple locators can be passed in order to switch between nested frames.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.selectFrame("//iframe[@id='frame1']");// Selects an iframe in the page and enters it. 
web.click("id=SaveButton");//Clicks on save that exists in an iframe
Parameters:
Name Type Description
frameLocator ...(String|Number) optionalA locator identifying the frame or iframe. Or a series of locators.

selectWindow(windowLocator)→ {String}

Selects window. Once window has been selected, all commands go to that window.

windowLocator can be:

  • title=TITLE - Switch to the first window which matches the specified title. TITLE can be any of the supported string matching patterns. When using title locator, this command will wait for the window to appear first similarly to waitForWindow command.
  • windowHandle - Switch to a window using its unique handle.
  • unspecified - Switch to the last opened window.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.selectWindow("title=Website");// Selects and focus a window.
Parameters:
Name Type Description
windowLocator String= optionalWindow locator.
Returns:
String - windowHandle of the previously selected window.

sendKeys(value)

Send a sequence of keyboard strokes to the active window or element.

Refer to Key Codes for the list of supported raw keyboard key codes.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.sendKeys(‘\uE03B’);//Types keys by reference to a key code.
Parameters:
Name Type Description
value String Sequence of key strokes to send.

setAutoWait(enable)

Specifies whether commands should automatically wait till element appears in the DOM and becomes visible, before executing.

By default automatic waiting is enabled. This setting affects all commands which expect to perform some action on elements, except wait*, assert*, is* and other commands which receive optional timeout parameter.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.setAutoWait(‘enable’);//Enables/disables auto wait to element in DOM
Parameters:
Name Type Description
enable Boolean true to enable automatic waiting, false to disable.

setTimeout(timeout)

Specifies the amount of time that Oxygen will wait for actions to complete.

This includes the open command, waitFor* commands, and all other commands which wait for elements to appear or become visible before operating on them.
If command wasn't able to complete within the specified period it will fail the test.
The default time-out is 60 seconds.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.setTimeout(60000);//Sets the time out to amount of milliseconds .
Parameters:
Name Type Description
timeout Number A time-out in milliseconds.

setWindowSize(width, height)

Sets the size of the outer browser window.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.setWindowSize(100,40);//Sets the window size (width and height) in pixels.
Parameters:
Name Type Description
width Number Width in pixels.
height Number Height in pixels.

takeScreenshot()→ {String}

Take a screenshot of the current page or screen and return it as base64 encoded string.


Usage example

web.init();
web.open("www.yourwebsite.com");
var ss = web.takeScreenshot();
require("fs").writeFileSync("c:\\screenshot.png", ss, 'base64');
Returns:
String - Screenshot image encoded as a base64 string.

type(locator, value)

Send a sequence of key strokes to an element (clears value before).

Refer to Key Codes for the list of supported raw keyboard key codes.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.type("id=UserName","User1");//Types a string to field.
Parameters:
Name Type Description
locator String An element locator.
value String The value to type.

waitForExist(locator, timeout)

Waits for element to become available in the DOM.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForExist("id=UserName");//Waits for an element to exist in DOM.
Parameters:
Name Type Description
locator String An element locator.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForNotExist(locator, timeout)

Waits for element to become unavailable in the DOM.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForNotExist("id=UserName");//Waits for an element to not exist in DOM.
Parameters:
Name Type Description
locator String An element locator.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForNotText(locator, pattern, timeout)

Waits for inner text of the given element to stop matching the specified pattern.

Text pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForNotText("id=Title","Website");//Waits for an element’s text to not match to expected string.
Parameters:
Name Type Description
locator String An element locator.
pattern String Text pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForNotValue(locator, pattern, timeout)

Waits for input element's value to stop matching the specified pattern.

Value pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForNotValue("id=UserName","User");//Waits for an element’s value to not match to expected string.
Parameters:
Name Type Description
locator String An element locator.
pattern String Value pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForText(locator, pattern, timeout)

Waits for inner text of the given element to match the specified pattern.

Text pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForText("id=Title","Website");//Waits for an element’s text to  match to expected string.
Parameters:
Name Type Description
locator String An element locator.
pattern String Text pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForValue(locator, pattern, timeout)

Waits for input element's value to match the specified pattern.

Value pattern can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForValue("id=Title","Website");//Waits for an element’s value to  match to expected string.
Parameters:
Name Type Description
locator String An element locator.
pattern String Value pattern.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForVisible(locator, timeout)

Waits for element to become visible.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForVisible("id=Title");//Waits for an element to  be visible.
Parameters:
Name Type Description
locator String An element locator.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.

waitForWindow(windowLocator, timeout)

Waits for a window to appear, but doesn't actually switches to it.

windowLocator can be:

  • title=TITLE - Wait for the first window which matches the specified title. TITLE can be any of the supported string matching patterns.


Usage example

web.init();//Opens browser session.
web.open("www.yourwebsite.com");// Opens a website.
web.waitForWindow("title=Website");//Waits for a window to appear.
Parameters:
Name Type Description
windowLocator String A window locator.
timeout Number= optionalTimeout in milliseconds. Default is 60 seconds.