Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-03

oracle.apps.fnd.applcore.test.selenium
Class ApplcoreSelenium

java.lang.Object
  extended by com.thoughtworks.selenium.DefaultSelenium
      extended by com.oracle.qa.selenium.ExtendedSelenium
          extended by oracle.apps.fnd.applcore.test.selenium.ApplcoreSelenium
All Implemented Interfaces:
com.thoughtworks.selenium.Selenium

public class ApplcoreSelenium
extends com.oracle.qa.selenium.ExtendedSelenium


Field Summary
static long INTERVAL
           
protected static long TIMEOUT
           
 
Fields inherited from class com.thoughtworks.selenium.DefaultSelenium
commandProcessor
 
Fields inherited from interface com.oracle.qa.selenium.Selenium
DEFAULT_TIMEOUT, PAGE_LOAD_TIMEOUT
 
Constructor Summary
ApplcoreSelenium(java.lang.String seleniumServerHost, int seleniumServerPort, java.lang.String browser, java.lang.String baseUrl)
          Constructor defers construction to parent.
 
Method Summary
 void captureScreenshot(java.lang.String filename)
          Capture a screen shot to the specified file.
 void clickAndWait(java.lang.String locator)
          Click on a link, button, checkbox, or radio button, and then wait for the page refresh.
 void clickAndWaitFor(java.lang.String clickLocator, java.lang.String waitLocator)
          This method is deprecated.
 void clickAndWaitForDisappear(java.lang.String clickLocator, java.lang.String waitLocator)
          Click on a link, button, checkbox, or radio button, and then wait for the page element disappears.
 void clickAndWaitForHide(java.lang.String clickLocator, java.lang.String waitLocator)
          Click on a link, button, checkbox, or radio button, and then wait for the page element hides.
 void clickAndWaitForPresent(java.lang.String clickLocator, java.lang.String waitLocator)
          Click on a link, button, checkbox, or radio button, and then wait for another page element present.
 void clickAndWaitForText(java.lang.String clickLocator, java.lang.String waitText)
          Click on a link, button, checkbox, or radio button, and then wait for another text to be present present.
 void clickAndWaitForVisible(java.lang.String clickLocator, java.lang.String waitLocator)
          Click on a link, button, checkbox, or radio button, and then wait for the page element become visible.
 void clickLink(java.lang.String lnk)
          Click on a link element which contains text matching the specified pattern.
 void clickLinkAndWait(java.lang.String lnk)
          Click on a link element and wait for the page refresh.
 void clickLinkAndWaitFor(java.lang.String lnk, java.lang.String waitLocator)
          Click on a link element and wait for another page element present.
 void clickLinkAndWaitForText(java.lang.String lnk, java.lang.String waitText)
          Click on a link element and wait for another text to be present.
 void clickTableCell(java.lang.String cellLocator, java.lang.String txt)
          Click on a table cell with the specified text.
 void collapseTreeTable(java.lang.String node)
          Collapse a parent node in a tree table.
 void expandTreeTable(java.lang.String node)
          Expand a parent node in a tree table.
 java.lang.String findTableCellAddrByTxt(java.lang.String cellLocator, java.lang.String txt)
          Find a table cell locator according to its text in a table.
 int findTableRowByTexts(java.lang.String cellLocator, java.lang.String[] rowTxts)
          Find the first row in the table, containing texts in the rowTxt array.
 int getTableColCount(java.lang.String tblLocator)
          Get the column number of a non-rowHeader table.
 java.lang.String getTableLocatorByCell(java.lang.String cellLocator)
          Get a table locator according to its cell locator, which can be recorded using selenium-IDE or firebug.
 int getTableRowCount(java.lang.String tblLocator)
          Get the row number of a non-rowHeader table.
 boolean isElementRequired(java.lang.String locator)
          Check whether a ui element is required.
 boolean isElementRequiredWithLabel(java.lang.String labelTxt)
          Check whether a ui element with label, labelTxt, is required.
 boolean isElementVisible(java.lang.String locator)
          Check whether a UI element is visible.
 boolean isTableCellPresent(java.lang.String cellLocator, java.lang.String txt)
          Verify whether a cell with the specified text exists in a table.
 boolean isTableRowPresent(java.lang.String cellLocator, java.lang.String[] rowTxts)
          Check whether a row exists in the table, containing texts in the rowTxt array.
 void loadMenu(java.lang.String menuName)
          Click the lazy-loaded menu and have its menu items fetched.
 void selectAndWait(java.lang.String locator, java.lang.String option)
          select some drop down value and wait for the page refresh.
 void setApplcoreTimeOut(long period)
          Change the default timeout.
 void setScreenshotPath(java.lang.String dir)
          Set the directory used to save captured screen shots.
 void typeAndWait(java.lang.String locator, java.lang.String val)
          Type some value in input field and wait for the page refresh.
 void waitForElementDisappear(java.lang.String elocator)
          Wait until a specified element disappears or timeout.
 void waitForElementHide(java.lang.String locator)
          Wait until a specified element hides or timeout.
 void waitForElementVisible(java.lang.String locator)
          Wait until a specified element is visible or timeout.
 void waitForServer()
          Wait until server and client complete data exchange or timeout.
 void waitForTextDisappear(java.lang.String txt)
          Wait until a specified text disappears in the page or timeout.
 void waitForTextPresent(java.lang.String txt)
          Wait until a specified text shown in the page or timeout.
 void waitForWindowDisappear(java.lang.String title)
          Wait until the window with the specified title disappear or timeout.
 void waitForWindowPresent(java.lang.String title)
          Wait until a secondary window with the specified title to apppear or timeout.
 
Methods inherited from class com.oracle.qa.selenium.ExtendedSelenium
callRichComponentFunction, callRichComponentFunctionChain, ctrlClick, dragAndDropUsingAWTRobot, getAllRichDialogIds, getCurrentUrl, getElementCenter, getElementCenterBiDi, getElementCode, getElementCoordinate, getElementPositionAndSize, getHTMLCode, getRichComponentProperty, getScrolledTo, getSeleniumBrowserLog, getWindowCoord, isBrowserMaximized, maxWindow, mouseClick, mouseClick, mouseOver, rightClick, selectAdfDialog, selectRichDialog, shiftClick, waitForElementPresent, waitForPageToLoad, waitForRichDialog, waitForRichDialogLaunch, waitForRichDialogReturn, waitForRichPageToLoad, waitForRichPopupHidden, waitForRichPopupVisible, waitForServer
 
Methods inherited from class com.thoughtworks.selenium.DefaultSelenium
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getEval, getExpression, getHtmlSource, getLocation, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPress, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForCondition, waitForFrameToLoad, waitForPageToLoad, waitForPopUp, windowFocus, windowMaximize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.thoughtworks.selenium.Selenium
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getEval, getExpression, getHtmlSource, getLocation, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPress, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForCondition, waitForFrameToLoad, waitForPageToLoad, waitForPopUp, windowFocus, windowMaximize
 

Field Detail

TIMEOUT

protected static long TIMEOUT

INTERVAL

public static final long INTERVAL
See Also:
Constant Field Values
Constructor Detail

ApplcoreSelenium

public ApplcoreSelenium(java.lang.String seleniumServerHost,
                        int seleniumServerPort,
                        java.lang.String browser,
                        java.lang.String baseUrl)
Constructor defers construction to parent.

Parameters:
seleniumServerHost - the host name on which the Selenium Server resides
seleniumServerPort - the port on which the Selenium Server is listening
browser - the command string used to launch the browser, e.g. "*firefox", "*iexplore" or "c:\\program files\\internet explorer\\iexplore.exe"
baseUrl - the starting URL including just a domain name. We'll start the browser pointing at the Selenium resources on this URL, e.g. "http://www.google.com" would send the browser to "http://www.google.com/selenium-server/SeleneseRunner.html"
Method Detail

setApplcoreTimeOut

public void setApplcoreTimeOut(long period)
Change the default timeout. It needs to be set in the constructor of testcase. Otherwise, some of wait functions may still stick to the default timeout.

Parameters:
period - the new timeout for wait functions

waitForServer

public void waitForServer()
Wait until server and client complete data exchange or timeout. The default timeout is 1 minute and can be changed by setApplcoreTimeOut().


clickAndWait

public void clickAndWait(java.lang.String locator)
Click on a link, button, checkbox, or radio button, and then wait for the page refresh. It equals to click() + waitForServer().

Parameters:
locator - an element locator

typeAndWait

public void typeAndWait(java.lang.String locator,
                        java.lang.String val)
Type some value in input field and wait for the page refresh. It equals to type() + waitForServer().

Parameters:
locator - an element locator
val - as Value

selectAndWait

public void selectAndWait(java.lang.String locator,
                          java.lang.String option)
select some drop down value and wait for the page refresh. It equals to select() + waitForServer().

Parameters:
locator - an element locator
option - as Value for option

clickAndWaitFor

public void clickAndWaitFor(java.lang.String clickLocator,
                            java.lang.String waitLocator)
This method is deprecated. Please switch to clickAndWaitForPresent().

Parameters:
clickLocator - a clickable page element locator, such as link, button, checkbox, or radio button.
waitLocator - a page element locator.

clickAndWaitForText

public void clickAndWaitForText(java.lang.String clickLocator,
                                java.lang.String waitText)
Click on a link, button, checkbox, or radio button, and then wait for another text to be present present. It equals to clickAndWait() + waitForTextPresent().

Parameters:
clickLocator - a clickable page element locator, such as link, button, checkbox, or radio button.
waitText - a page text to be verified.

clickLink

public void clickLink(java.lang.String lnk)
Click on a link element which contains text matching the specified pattern.

Parameters:
lnk - the link text pattern.

clickLinkAndWait

public void clickLinkAndWait(java.lang.String lnk)
Click on a link element and wait for the page refresh. It equals to clickLink() + waitForServer();

Parameters:
lnk - the link text pattern.

clickLinkAndWaitFor

public void clickLinkAndWaitFor(java.lang.String lnk,
                                java.lang.String waitLocator)
Click on a link element and wait for another page element present. It equals to clickLink() + waitForElementPresent().

Parameters:
lnk - the link text pattern.
waitLocator - a page element locator.

clickLinkAndWaitForText

public void clickLinkAndWaitForText(java.lang.String lnk,
                                    java.lang.String waitText)
Click on a link element and wait for another text to be present. It equals to clickLink() + waitForTextPresent().

Parameters:
lnk - the link text pattern.
waitText - a page text to be waited for

getTableRowCount

public int getTableRowCount(java.lang.String tblLocator)
Get the row number of a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
tblLocator - a table locator.
Returns:
the row number.

getTableColCount

public int getTableColCount(java.lang.String tblLocator)
Get the column number of a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
tblLocator - a table locator.
Returns:
the column number or -1 if the table is empty.

getTableLocatorByCell

public java.lang.String getTableLocatorByCell(java.lang.String cellLocator)
Get a table locator according to its cell locator, which can be recorded using selenium-IDE or firebug. It is only used for a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
cellLocator - a table cell locator.
Returns:
table locator.

findTableCellAddrByTxt

public java.lang.String findTableCellAddrByTxt(java.lang.String cellLocator,
                                               java.lang.String txt)
Find a table cell locator according to its text in a table. Since the order of row and column in a table may change at will, this function is needed to iterate a table. It is only used for a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
cellLocator - a table cell locator.
txt - text of the wanted table cell.

isTableCellPresent

public boolean isTableCellPresent(java.lang.String cellLocator,
                                  java.lang.String txt)
Verify whether a cell with the specified text exists in a table. Since the order of row and column in a table may change at will, this function will check by iterating the table. It is only used for a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
cellLocator - a table cell locator.
txt - text of the wanted table cell.

clickTableCell

public void clickTableCell(java.lang.String cellLocator,
                           java.lang.String txt)
Click on a table cell with the specified text. It is only used for a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
cellLocator - a table cell locator
txt - text of the wanted table cell

findTableRowByTexts

public int findTableRowByTexts(java.lang.String cellLocator,
                               java.lang.String[] rowTxts)
Find the first row in the table, containing texts in the rowTxt array. The row number starts from 0. It only used for a non-rowHeader table. Non-rowHeader table means none of table columns enables the rowHeader property.

Parameters:
cellLocator - the locator of a cell in the table
rowTxts - array of texts contained in the row cells, which can identify a row in the table
Returns:
row number or -1

isTableRowPresent

public boolean isTableRowPresent(java.lang.String cellLocator,
                                 java.lang.String[] rowTxts)
Check whether a row exists in the table, containing texts in the rowTxt array. It only works for a non-rowHeader table. Non-rowHeader table means none of table columns enable the rowHeader property.

Parameters:
cellLocator - the locator of a cell in the table
rowTxts - array of texts contained in the row cells, which can identify a row in the table
Returns:
true if the specified row exists, false otherwise.

expandTreeTable

public void expandTreeTable(java.lang.String node)
Expand a parent node in a tree table.

Parameters:
node - the text appears in the node table cell.

collapseTreeTable

public void collapseTreeTable(java.lang.String node)
Collapse a parent node in a tree table.

Parameters:
node - the text appears in the node table cell.

waitForElementDisappear

public void waitForElementDisappear(java.lang.String elocator)
Wait until a specified element disappears or timeout.

Parameters:
elocator - an element locator

waitForElementVisible

public void waitForElementVisible(java.lang.String locator)
Wait until a specified element is visible or timeout.

Parameters:
locator - an element locator.

waitForElementHide

public void waitForElementHide(java.lang.String locator)
Wait until a specified element hides or timeout.

Parameters:
locator - an element locator.

waitForTextPresent

public void waitForTextPresent(java.lang.String txt)
Wait until a specified text shown in the page or timeout.

Parameters:
txt - the specified text.

waitForTextDisappear

public void waitForTextDisappear(java.lang.String txt)
Wait until a specified text disappears in the page or timeout.

Parameters:
txt - the specified text.

waitForWindowPresent

public void waitForWindowPresent(java.lang.String title)
Wait until a secondary window with the specified title to apppear or timeout.

Parameters:
title - the specified title for a secondary window.

waitForWindowDisappear

public void waitForWindowDisappear(java.lang.String title)
Wait until the window with the specified title disappear or timeout.

Parameters:
title - the specified title for a window.

setScreenshotPath

public void setScreenshotPath(java.lang.String dir)
Set the directory used to save captured screen shots.

Parameters:
dir - a directory

captureScreenshot

public void captureScreenshot(java.lang.String filename)
Capture a screen shot to the specified file.

Specified by:
captureScreenshot in interface com.thoughtworks.selenium.Selenium
Overrides:
captureScreenshot in class com.thoughtworks.selenium.DefaultSelenium
Parameters:
filename - the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"

loadMenu

public void loadMenu(java.lang.String menuName)
Click the lazy-loaded menu and have its menu items fetched.

Parameters:
menuName - the locator of the menu element, usually a link

isElementRequired

public boolean isElementRequired(java.lang.String locator)
Check whether a ui element is required.

Parameters:
locator - a ui element locator.

isElementRequiredWithLabel

public boolean isElementRequiredWithLabel(java.lang.String labelTxt)
Check whether a ui element with label, labelTxt, is required.

Parameters:
labelTxt - the label of a ui element locator.

clickAndWaitForPresent

public void clickAndWaitForPresent(java.lang.String clickLocator,
                                   java.lang.String waitLocator)
Click on a link, button, checkbox, or radio button, and then wait for another page element present.

Parameters:
clickLocator - a clickable page element locator, such as link, button, checkbox, or radio button.
waitLocator - a page element locator.

clickAndWaitForDisappear

public void clickAndWaitForDisappear(java.lang.String clickLocator,
                                     java.lang.String waitLocator)
Click on a link, button, checkbox, or radio button, and then wait for the page element disappears. present.

Parameters:
clickLocator - a clickable page element locator, such as link, button, checkbox, or radio button.
waitLocator - a page element locator.

clickAndWaitForVisible

public void clickAndWaitForVisible(java.lang.String clickLocator,
                                   java.lang.String waitLocator)
Click on a link, button, checkbox, or radio button, and then wait for the page element become visible. present.

Parameters:
clickLocator - a clickable page element locator, such as link, button, checkbox, or radio button.
waitLocator - a page element locator.

clickAndWaitForHide

public void clickAndWaitForHide(java.lang.String clickLocator,
                                java.lang.String waitLocator)
Click on a link, button, checkbox, or radio button, and then wait for the page element hides. present.

Parameters:
clickLocator - a clickable page element locator, such as link, button, checkbox, or radio button.
waitLocator - a page element locator.

isElementVisible

public boolean isElementVisible(java.lang.String locator)
Check whether a UI element is visible.

Returns:
whether it is visible.

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-03

Copyright © 2012 Oracle. All Rights Reserved.