Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ide_script [2020/05/28 02:21] – [ShortCut Keys] 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 16: | Line 16: | ||
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: | ||
Line 24: | 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 93: | 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 102: | 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 112: | 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 120: | 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 128: | Line 140: | ||
| | ||
def ' | def ' | ||
- | $SYS.log(' | + | $EXEC.log(' |
- | $SYS.page(' | + | $PAGE.page(' |
} | } | ||
Line 148: | 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 171: | 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 184: | 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 200: | 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. | ||
---- | ---- |