Index: lams_build/lib/selenium/user-extensions.js =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/selenium/Attic/user-extensions.js,v diff -u -r1.1 -r1.2 --- lams_build/lib/selenium/user-extensions.js 13 Jul 2009 04:38:56 -0000 1.1 +++ lams_build/lib/selenium/user-extensions.js 19 Jul 2009 23:52:33 -0000 1.2 @@ -35,32 +35,28 @@ Selenium.prototype.callFlexMethod = function (method, id, args) { if (this.flashObjectLocator === null){ - this.flashObjectLocator = "CloudWizard";//this.getFlexObject(); + this.flashObjectLocator = "CloudWizard"; } // the object that contains the exposed Flex functions var funcObj = null; // get the flash object var flashObj = selenium.browserbot.findElement(this.flashObjectLocator); - - if (flashObj.wrappedJSObject) { - flashObj = flashObj.wrappedJSObject; - } - + // find object holding functions - if(typeof(flashObj[method]) == 'function') - // for IE (will be the flash object itself) + if((typeof(flashObj[method]) == 'function') || (typeof(flashObj[method]) == 'object')) +// // for IE (will be the flash object itself) funcObj = flashObj; - else { - // Firefox (will be a child of the flash object) - for(var i = 0; i < flashObj.childNodes.length; i++) { - var tmpFuncObj = flashObj.childNodes[i]; - if(typeof(tmpFuncObj) == 'function') { - funcObj = tmpFuncObj; - break; - } - } - } +// else { +// // Firefox (will be a child of the flash object) +// for(var i = 0; i < flashObj.childNodes.length; i++) { +// var tmpFuncObj = flashObj.childNodes[i]; +// if(typeof(tmpFuncObj) == 'function') { +// funcObj = tmpFuncObj; +// break; +// } +// } +// } // throw a error to Selenium if the exposed function could not be found if(funcObj == null) @@ -105,148 +101,98 @@ return this.callFlexMethod('getFlexProperty', ID, property); }; -Selenium.prototype.getFlexSelectedItemAtIndex = function(id) { - return this.callFlexMethod('getFlexSelectedItemAtIndex', id); +Selenium.prototype.doFlexAlertResponse = function(id, args) { + var retval = this.callFlexMethod('doFlexAlertResponse', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexNumSelectedItems = function(id) { - return this.callFlexMethod('getFlexNumSelectedItems', id); +Selenium.prototype.doFlexCheckBox = function(id, args) { + var retval = this.callFlexMethod('doFlexCheckBox', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexVisible = function(id) { - return this.callFlexMethod('getFlexVisible', id); +Selenium.prototype.doFlexClick = function(id, args) { + var retval = this.callFlexMethod('doFlexClick', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexTextPresent = function(id) { - return this.callFlexMethod('getFlexTextPresent', id); +Selenium.prototype.doFlexClickDataGridItem = function(id, args) { + var retval = this.callFlexMethod('doFlexClickDataGridItem', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexText = function(id) { - return this.callFlexMethod('getFlexText', id); +Selenium.prototype.doFlexClickDataGridUIComponent = function(id, args) { + var retval = this.callFlexMethod('doFlexClickDataGridUIComponent', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexStepper = function(id) { - return this.callFlexMethod('getFlexStepper', id); +Selenium.prototype.doFlexClickMenuBarUIComponent = function(id, args) { + var retval = this.callFlexMethod('doFlexClickMenuBarUIComponent', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexSelectionIndex = function(id) { - return this.callFlexMethod('getFlexSelectionIndex', id); +Selenium.prototype.doFlexDate = function(id, args) { + var retval = this.callFlexMethod('doFlexDate', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexSelection = function(id) { - return this.callFlexMethod('getFlexSelection', id); +Selenium.prototype.doFlexDoubleClick = function(id, args) { + var retval = this.callFlexMethod('doFlexDoubleClick', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexRadioButton = function(id) { - return this.callFlexMethod('getFlexRadioButton', id); +Selenium.prototype.doFlexDragTo = function(id, args) { + var retval = this.callFlexMethod('doFlexDragTo', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexParseInt = function(id) { - return this.callFlexMethod('getFlexParseInt', id); +Selenium.prototype.doFlexMouseDown = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseDown', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexNumeric = function(id) { - return this.callFlexMethod('getFlexNumeric', id); +Selenium.prototype.doFlexMouseMove = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseMove', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexGlobalPosition = function(id) { - return this.callFlexMethod('getFlexGlobalPosition', id); +Selenium.prototype.doFlexMouseOver = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseOver', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexExists = function(id) { - return this.callFlexMethod('getFlexExists', id); +Selenium.prototype.doFlexMouseRollOut = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseRollOut', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexErrorString = function(id) { - return this.callFlexMethod('getFlexErrorString', id); +Selenium.prototype.doFlexMouseRollOver = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseRollOver', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexEnabled = function(id) { - return this.callFlexMethod('getFlexEnabled', id); -}; - -Selenium.prototype.getFlexDate = function(id) { - return this.callFlexMethod('getFlexDate', id); -}; - -Selenium.prototype.getFlexDataGridUIComponentLabel = function(id) { - return this.callFlexMethod('getFlexDataGridUIComponentLabel', id); -}; - -Selenium.prototype.getFlexDataGridRowIndexForFieldValue = function(id) { - return this.callFlexMethod('getFlexDataGridRowIndexForFieldValue', id); -}; - -Selenium.prototype.getFlexDataGridRowCount = function(id) { - return this.callFlexMethod('getFlexDataGridRowCount', id); -}; - -Selenium.prototype.getFlexDataGridFieldValueForGridRow = function(id) { - return this.callFlexMethod('getFlexDataGridFieldValueForGridRow', id); -}; - -Selenium.prototype.getFlexDataGridCellText = function(id) { - return this.callFlexMethod('getFlexDataGridCellText', id); -}; - -Selenium.prototype.getFlexDataGridCell = function(id) { - return this.callFlexMethod('getFlexDataGridCell', id); -}; - -Selenium.prototype.getFlexComponentInfo = function(id) { - return this.callFlexMethod('getFlexComponentInfo', id); -}; - -Selenium.prototype.getFlexComboContainsLabel = function(id) { - return this.callFlexMethod('getFlexComboContainsLabel', id); -}; - -Selenium.prototype.getFlexCheckBoxChecked = function(id) { - return this.callFlexMethod('getFlexCheckBoxChecked', id); -}; - -Selenium.prototype.getFlexAlertTextPresent = function(id) { - return this.callFlexMethod('getFlexAlertTextPresent', id); -}; - -Selenium.prototype.getFlexAlertText = function(id) { - return this.callFlexMethod('getFlexAlertText', id); -}; - -Selenium.prototype.getFlexAlertPresent = function(id) { - return this.callFlexMethod('getFlexAlertPresent', id); -}; - -Selenium.prototype.getDataGridUIComponentLabel = function(id) { - return this.callFlexMethod('getDataGridUIComponentLabel', id); -}; - -Selenium.prototype.getDataGridCellText = function(id) { - return this.callFlexMethod('getDataGridCellText', id); -}; - -Selenium.prototype.doRefreshIDToolTips = function(id, args) { - var retval = this.callFlexMethod('doRefreshIDToolTips', id, args); +Selenium.prototype.doFlexMouseUp = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseUp', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexWaitForElementVisible = function(id, args) { - var retval = this.callFlexMethod('doFlexWaitForElementVisible', id, args); +Selenium.prototype.doFlexProperty = function(id, args) { + var retval = this.callFlexMethod('doFlexProperty', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexWaitForElement = function(id, args) { - var retval = this.callFlexMethod('doFlexWaitForElement', id, args); +Selenium.prototype.doFlexRadioButton = function(id, args) { + var retval = this.callFlexMethod('doFlexRadioButton', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexTypeAppend = function(id, args) { - var retval = this.callFlexMethod('doFlexTypeAppend', id, args); +Selenium.prototype.doFlexSelect = function(id, args) { + var retval = this.callFlexMethod('doFlexSelect', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexType = function(id, args) { - var retval = this.callFlexMethod('doFlexType', id, args); +Selenium.prototype.doFlexSelectIndex = function(id, args) { + var retval = this.callFlexMethod('doFlexSelectIndex', id, args); if(retval != 'true') throw new SeleniumError(retval); }; @@ -255,132 +201,111 @@ if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSetFocus = function(id, args) { - var retval = this.callFlexMethod('doFlexSetFocus', id, args); +Selenium.prototype.doFlexType = function(id, args) { + var retval = this.callFlexMethod('doFlexType', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSetDataGridCell = function(id, args) { - var retval = this.callFlexMethod('doFlexSetDataGridCell', id, args); +Selenium.prototype.doFlexTypeAppend = function(id, args) { + var retval = this.callFlexMethod('doFlexTypeAppend', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelectMatchingOnField = function(id, args) { - var retval = this.callFlexMethod('doFlexSelectMatchingOnField', id, args); +Selenium.prototype.doFlexWaitForElement = function(id, args) { + var retval = this.callFlexMethod('doFlexWaitForElement', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelectIndex = function(id, args) { - var retval = this.callFlexMethod('doFlexSelectIndex', id, args); +Selenium.prototype.doFlexWaitForElementVisible = function(id, args) { + var retval = this.callFlexMethod('doFlexWaitForElementVisible', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelectComboByLabel = function(id, args) { - var retval = this.callFlexMethod('doFlexSelectComboByLabel', id, args); +Selenium.prototype.doFlexRefreshIDToolTips = function(id, args) { + var retval = this.callFlexMethod('doFlexRefreshIDToolTips', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelect = function(id, args) { - var retval = this.callFlexMethod('doFlexSelect', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexDataGridUIComponentLabel = function(id) { + return this.callFlexMethod('getFlexDataGridUIComponentLabel', id); }; -Selenium.prototype.doFlexRefreshIDToolTips = function(id, args) { - var retval = this.callFlexMethod('doFlexRefreshIDToolTips', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexAlertPresent = function(id) { + return this.callFlexMethod('getFlexAlertPresent', id); }; -Selenium.prototype.doFlexRadioButton = function(id, args) { - var retval = this.callFlexMethod('doFlexRadioButton', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexAlertText = function(id) { + return this.callFlexMethod('getFlexAlertText', id); }; -Selenium.prototype.doFlexProperty = function(id, args) { - var retval = this.callFlexMethod('doFlexProperty', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexAlertTextPresent = function(id) { + return this.callFlexMethod('getFlexAlertTextPresent', id); }; -Selenium.prototype.doFlexMouseUp = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseUp', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexCheckBoxChecked = function(id) { + return this.callFlexMethod('getFlexCheckBoxChecked', id); }; -Selenium.prototype.doFlexMouseRollOver = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseRollOver', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexComponentInfo = function(id) { + return this.callFlexMethod('getFlexComponentInfo', id); }; -Selenium.prototype.doFlexMouseRollOut = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseRollOut', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexDataGridCellText = function(id) { + return this.callFlexMethod('getFlexDataGridCellText', id); }; -Selenium.prototype.doFlexMouseOver = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseOver', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexDate = function(id) { + return this.callFlexMethod('getFlexDate', id); }; -Selenium.prototype.doFlexMouseMove = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseMove', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexEnabled = function(id) { + return this.callFlexMethod('getFlexEnabled', id); }; -Selenium.prototype.doFlexMouseDown = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseDown', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexErrorString = function(id) { + return this.callFlexMethod('getFlexErrorString', id); }; -Selenium.prototype.doFlexDragTo = function(id, args) { - var retval = this.callFlexMethod('doFlexDragTo', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexExists = function(id) { + return this.callFlexMethod('getFlexExists', id); }; -Selenium.prototype.doFlexDoubleClick = function(id, args) { - var retval = this.callFlexMethod('doFlexDoubleClick', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexGlobalPosition = function(id) { + return this.callFlexMethod('getFlexGlobalPosition', id); }; -Selenium.prototype.doFlexDate = function(id, args) { - var retval = this.callFlexMethod('doFlexDate', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexNumeric = function(id) { + return this.callFlexMethod('getFlexNumeric', id); }; -Selenium.prototype.doFlexClickMenuBarUIComponent = function(id, args) { - var retval = this.callFlexMethod('doFlexClickMenuBarUIComponent', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexParseInt = function(id) { + return this.callFlexMethod('getFlexParseInt', id); }; -Selenium.prototype.doFlexClickDataGridUIComponent = function(id, args) { - var retval = this.callFlexMethod('doFlexClickDataGridUIComponent', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexRadioButton = function(id) { + return this.callFlexMethod('getFlexRadioButton', id); }; -Selenium.prototype.doFlexClickDataGridItem = function(id, args) { - var retval = this.callFlexMethod('doFlexClickDataGridItem', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexSelection = function(id) { + return this.callFlexMethod('getFlexSelection', id); }; -Selenium.prototype.doFlexClick = function(id, args) { - var retval = this.callFlexMethod('doFlexClick', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexSelectionIndex = function(id) { + return this.callFlexMethod('getFlexSelectionIndex', id); }; -Selenium.prototype.doFlexCheckBox = function(id, args) { - var retval = this.callFlexMethod('doFlexCheckBox', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexStepper = function(id) { + return this.callFlexMethod('getFlexStepper', id); }; -Selenium.prototype.doFlexAlertResponse = function(id, args) { - var retval = this.callFlexMethod('doFlexAlertResponse', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexText = function(id) { + return this.callFlexMethod('getFlexText', id); }; -Selenium.prototype.doFlexAddSelectMatchingOnField = function(id, args) { - var retval = this.callFlexMethod('doFlexAddSelectMatchingOnField', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexTextPresent = function(id) { + return this.callFlexMethod('getFlexTextPresent', id); }; -Selenium.prototype.doFlexAddSelectIndex = function(id, args) { - var retval = this.callFlexMethod('doFlexAddSelectIndex', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexVisible = function(id) { + return this.callFlexMethod('getFlexVisible', id); };