Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ide_script [2020/06/01 15:14] – [Editor Overview] admin | ide_script [2024/01/02 19:49] (current) – [User Script] admin | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| * auto formatting | * auto formatting | ||
| * code collapse | * code collapse | ||
| - | * code assist | + | * [[#code assist]] |
| * search | * search | ||
| * replace | * replace | ||
| Line 17: | Line 17: | ||
| The tool pallet on the upper-right corner of the editor gives you quick access to common editor features. | The tool pallet on the upper-right corner of the editor gives you quick access to common editor features. | ||
| {{ wiki: | {{ wiki: | ||
| - | |||
| - | // | ||
| - | * on a blank line or after a " | ||
| - | {{ wiki: | ||
| - | * on chained system or plugin function calls | ||
| - | {{ wiki: | ||
| - | * on java classes | ||
| - | {{ wiki: | ||
| The info mini-button **i** gives more detailed information on these editor features. | The info mini-button **i** gives more detailed information on these editor features. | ||
| Line 31: | Line 23: | ||
| ---- | ---- | ||
| - | ==== Plugins ==== | ||
| - | //Plugins// extends the capability of // | ||
| - | {{ wiki:idescreen: | + | ==== Code Assist ==== |
| + | Code assist is supported on [[https:// | ||
| - | Activated plugins will automatically added to code assist | + | Code assist |
| + | * on a blank line or after a " | ||
| + | |||
| + | {{wiki: | ||
| + | |||
| + | * on chained system or plugin function calls | ||
| + | |||
| + | {{wiki: | ||
| + | |||
| + | * on java classes | ||
| + | |||
| + | {{wiki: | ||
| + | |||
| + | ---- | ||
| + | ==== Plugins ==== | ||
| + | //Plugins// extends the capability of // | ||
| - | More info can be found at [[Plugins]] and [[http:// | ||
| ---- | ---- | ||
| Line 100: | Line 105: | ||
| === Create Page Objects === | === Create Page Objects === | ||
| Use the following script to create a new page object: | Use the following script to create a new page object: | ||
| - | page1 = $SYS.addPage(' | + | page1 = $PAGE.addPage(' |
| - | page1 = $SYS.getPageMgr().addPage(' | + | |
| Line 109: | Line 113: | ||
| Use the following script to add a page action to a page: | Use the following script to add a page action to a page: | ||
| | | ||
| - | $SYS.log(' | + | $EXEC.log(' |
| - | $SELENIUM.getWebDriver().findElement(By.tagName(' | + | $VAR.webdriver.findElement(By.tagName(' |
| }) | }) | ||
| + | |||
| + | assuming that $VAR.webdriver has been assigned to WebDriver object that you have created. | ||
| === Add Page Elements === | === Add Page Elements === | ||
| Line 119: | Line 125: | ||
| Use the following script to add a page element to a page: | Use the following script to add a page element to a page: | ||
| | | ||
| - | |||
| | | ||
| === Add Element Actions === | === Add Element Actions === | ||
| Line 127: | Line 132: | ||
| Use the following script to add an element action to an element: | Use the following script to add an element action to an element: | ||
| | | ||
| - | $SYS.log(' | + | $EXEC.log(' |
| - | $SELENIUM.getWebDriver().findElement(elem.getLocator()).click(); | + | $VAR.webdriver.findElement(elem.getLocator()).click(); |
| }) | }) | ||
| Line 135: | Line 140: | ||
| | | ||
| def ' | def ' | ||
| - | $SYS.log(' | + | $EXEC.log(' |
| - | $SYS.page(' | + | $PAGE.page(' |
| } | } | ||
| Line 155: | Line 160: | ||
| //Steps// are annotated groovy functions as follows: | //Steps// are annotated groovy functions as follows: | ||
| - | | ||
| - | def setBrowserType (String browserType) { | ||
| - | $SELENIUM.setBrowserType(browserType); | ||
| - | } | ||
| - | |||
| | | ||
| def gotoURL (String url) { | def gotoURL (String url) { | ||
| - | $SELENIUM.getWebDriver().get(url); | + | $VAR.webdriver.get(url); |
| } | } | ||
| | | ||
| def loginAs (String userid, String password) { | def loginAs (String userid, String password) { | ||
| - | $SELENIUM.getWebDriver().findElement(By.id(' | + | $VAR.webdriver.findElement(By.id(' |
| - | $SELENIUM.getWebDriver().findElement(By.id(' | + | $VAR.webdriver.findElement(By.id(' |
| } | } | ||
| Line 178: | Line 178: | ||
| //MCASE Script// is where //MCase// are defined. | //MCASE Script// is where //MCase// are defined. | ||
| - | // | + | Often times you may have a set of specific test scenarios you want to make sure are covered to complement the system generated test cases. |
| Consider your model as a map to //GPS//, //MCase// is just a set of way points you want to visit. When you execute //MCase//, a sequence | Consider your model as a map to //GPS//, //MCase// is just a set of way points you want to visit. When you execute //MCase//, a sequence | ||
| - | $SYS.getMCaseMgr().addMCase(' | + | $MCASE.addMCase(' |
| - | $SYS.getMCaseMgr().addMCase(' | + | $MCASE.addMCase(' |
| In additional to follow through path and execute the automation script (// | In additional to follow through path and execute the automation script (// | ||
| Line 191: | Line 191: | ||
| ---- | ---- | ||
| ==== User Script ==== | ==== User Script ==== | ||
| - | Besides [[#TRIGGER Script]], [[#PAGES Sript]] | + | Besides [[#TRIGGER Script]], [[#PAGES Sript]], [[# |
| To create a user script, click on " | To create a user script, click on " | ||
| Line 207: | Line 207: | ||
| | | ||
| def ' | def ' | ||
| - | $SYS.log(' | + | $EXEC.log(' |
| - | $SYS.log(' | + | $EXEC.log(' |
| } | } | ||
| + | |||
| + | ---- | ||
| + | ==== Include File ==== | ||
| + | You may include script file into your TRIGGER script. | ||
| + | | ||
| + | |||
| + | The above script will literally inject the content of the included file into current script before TRIGGER script is executed. | ||
| + | |||
| + | The side effect of using this INCLUDE_FILE is that the injected scripts will mess up the script line # reported on errors. | ||
| ---- | ---- | ||