...
Use the following table as a reference when determining whether a certain Selenium IDE command is compatible with your ASM Scenario.
Actions | Keyboard & Mouse interaction | Verification and Assertion | Waits | Scenario Flow | JS Execution | Stored Variables | Custom (ASM Specific) Commands |
---|---|---|---|---|---|---|---|
open | keyDown | assertElementPresent | waitForVisible | gotoIf | fireEvent | storeTitle | setPageBreak |
clickAndWait | keyDownAndWait | assertTitle | waitForText | goto | runScript | storeXpathCount | insertPageBreak |
clickAtAndWait | keyUp | assertLocation | waitForValue | label | getEval | storeCssCount | takeScreenshot |
clickAndNotWait | keyUpAndWait | assertVisible | waitForAttribute | close | runScriptAndWait | storeValue | startRecording |
click | keyPress | assertElementNotPresent | waitForNotText | pause | executeScript | storeText | clearRecording |
clickAt | keyPressAndWait | assertNotVisible | waitForNotValue | setSpeed | storeLocation | stopRecording |
doubleClick | mouseOver | assertAttribute | waitForNotAttribute | setTimeout | storeExpression | getDictionary |
doubleClickAt | assertNotAttribute |
waitForText | echo | storeEval |
doubleClickAndWait | assertValue |
waitForTextPresent | storeAttribute |
doubleClickAtAndWait | assertNotValue |
waitForTextNotPresent | storeElementPresent |
clickInvisible | assertText |
waitForElementPresent | store |
clickInvisibleAndWait | assertTextNotPresent | waitForEditable | |||||
type | assertTextPresent | waitForElementNotPresent |
sendKeys |
assertExpression | waitForNotVisible |
typeKeys | assertNextConfirmation | waitForTitle | |||||
select |
assertNextAlert | waitForLocation | |||||
selectAndWait |
assertAlert | waitForAlert | |||||
selectFrame |
assertConfirmation | waitForConfirmation |
selectWindow | assertEval | waitForPageToLoad | |||||
submit | verifyTitle | ||||||
createCookie | verifyLocation | ||||||
deleteCookie | verifyElementPresent | ||||||
quit | verifyVisible | ||||||
_chromeDebugExec | verifyElementNotPresent | ||||||
verifyNotVisible | |||||||
verifyAttribute | |||||||
verifyNotAttribute | |||||||
verifyValue | |||||||
verifyNotValue | |||||||
verifyText | |||||||
verifyTextNotPresent | |||||||
verifyTextPresent | |||||||
verifyExpression | |||||||
Custom ASM Commands
ASM supports several commands which are not utilized in native Selenium IDE: insertPageBreak, takeScreenshot, and getDictionary.
...
When using sendKeys in Selenium IDE, the key codes ${KEY_ENTER}
, ${KEY_SHIFT}
, and ${KEY_LEFT}
are not valid commands within Selenium IDE. Use keyPress
or keyPressAndWait
(if the keystroke triggers a new page load) instead. When entering a keystroke, use the respective ASCII values for the key you want to be pressed. For example, if you want to press Enter within an application, use the command keyPress
and the value \13
.
Command | Target | Value |
| | |
JavaScript Execution
Selenium WebDriver’s JavascriptExecutor
will wrap all JavaScript and evaluate it as an anonymous expression. Therefore, the “return” keyword must be used when executing JavaScript within the “Target” field in an ASM scenario. For example, the command browserbot.getCurrentWindow().document.title
in Selenium becomes return document.title;
in an ASM Scenario.
If your Selenium IDE looks like the following:
Command | Target | Value |
|
|
|
Add a “return” keyword to the target so it looks like the following:
Command | Target | Value |
|
|
|
The following commands result in javascript evaluation or expect a javascript snippet as an argument. Therefore, they also require the use of “return”:
...
It is currently not possible to change the value of a variable from within a JavaScript snippet. This Selenium IDE code will change the value of $counter
:
Command | Target | Value |
|
|
|
The following command will not change the value of $counter
:
Command | Target | Value |
|
|
|
...
Info |
---|
Knowing how to increment a value is useful when running through a loop in an ASM script! |
...