Wednesday, November 5, 2014
Selenium Commands – Selenese
Selenese commands can have up to a maximum of two parameters: target and value.
Parameters are not required all the time. It depends on how many the command will need.
3 Types of Commands
Actions | These are commands that directly interact with page elements.Example: the “click” command is an action because you directly interact with the element you are clicking at.The “type” command is also an action because you are putting values into a text box, and the text box shows them to you in return. There is a two-way interaction between you and the text box. |
Accessors | They are commands that allow you to store values to a variable.Example: the “storeTitle” command is an accessor because it only “reads” the page title and saves it in a variable. It does not interact with any element on the page. |
Assertions | They are commands that verify if a certain condition is met. 3 Types of AssertionsAssert. When an “assert” command fails, the test is stopped immediately.Verify. When a “verify” command fails, Selenium IDE logs this failure and continues with the test execution.WaitFor. Before proceeding to the next command, “waitFor” commands will first wait for a certain condition to become true.If the condition becomes true within the waiting period, the step passes.If the condition does not become true, the step fails. Failure is logged, and test execution proceeds to the next command. By default, timeout value is set to 30 seconds. You can change this in the Selenium IDE Options dialog under the General tab. |


Commonly Used Selenium Commands
To conclude our introduction of Selenium, we’ll show you a few typical Selenium commands. These are probably the most commonly used commands for building tests.
- open : opens a page using a URL.
- click/clickAndWait : performs a click operation, and optionally waits for a new page to load.
- verifyTitle/assertTitle: verifies an expected page title.
- verifyTextPresent: verifies expected text is somewhere on the page.
- verifyElementPresent: verifies an expected UI element, as defined by its HTML tag, is present on the page.
- verifyText: verifies expected text and its corresponding HTML tag are present on the page.
- verifyTable: verifies a table’s expected contents.
- waitForPageToLoad: pauses execution until an expected new page loads. Called automatically when clickAndWait is used.
- waitForElementPresent: pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.
List of Selenium IDE Commands:
addLocationStrategy |
addLocationStrategyAndWait |
addScript |
addScriptAndWait |
addSelection |
addSelectionAndWait |
allowNativeXpath |
allowNativeXpathAndWait |
altKeyDown |
altKeyDownAndWait |
altKeyUp |
altKeyUpAndWait |
answerOnNextPrompt |
assertAlert |
assertAlertNotPresent |
assertAlertPresent |
assertAllButtons |
assertAllFields |
assertAllLinks |
assertAllWindowIds |
assertAllWindowNames |
assertAllWindowTitles |
assertAttribute |
assertAttributeFromAllWindows |
assertBodyText |
assertChecked |
assertConfirmation |
assertConfirmationNotPresent |
assertConfirmationPresent |
assertCookie |
assertCookieByName |
assertCookieNotPresent |
assertCookiePresent |
assertCursorPosition |
assertEditable |
assertElementHeight |
assertElementIndex |
assertElementNotPresent |
assertElementPositionLeft |
assertElementPositionTop |
assertElementPresent |
assertElementWidth |
assertEval |
assertExpression |
assertHtmlSource |
assertLocation |
assertMouseSpeed |
assertNotAlert |
assertNotAllButtons |
assertNotAllFields |
assertNotAllLinks |
assertNotAllWindowIds |
assertNotAllWindowNames |
assertNotAllWindowTitles |
assertNotAttribute |
assertNotAttributeFromAllWindows |
assertNotBodyText |
assertNotChecked |
assertNotConfirmation |
assertNotCookie |
assertNotCookieByName |
assertNotCursorPosition |
assertNotEditable |
assertNotElementHeight |
assertNotElementIndex |
assertNotElementPositionLeft |
assertNotElementPositionTop |
assertNotElementWidth |
assertNotEval |
assertNotExpression |
assertNotHtmlSource |
assertNotLocation |
assertNotMouseSpeed |
assertNotOrdered |
assertNotPrompt |
assertNotSelectOptions |
assertNotSelectedId |
assertNotSelectedIds |
assertNotSelectedIndex |
assertNotSelectedIndexes |
assertNotSelectedLabel |
assertNotSelectedLabels |
assertNotSelectedValue |
assertNotSelectedValues |
assertNotSomethingSelected |
assertNotSpeed |
assertNotTable |
assertNotText |
assertNotTitle |
assertNotValue |
assertNotVisible |
assertNotWhetherThisFrameMatchFrameExpression |
assertNotWhetherThisWindowMatchWindowExpression |
assertNotXpathCount |
assertOrdered |
assertPrompt |
assertPromptNotPresent |
assertPromptPresent |
assertSelectOptions |
assertSelectedId |
assertSelectedIds |
assertSelectedIndex |
assertSelectedIndexes |
assertSelectedLabel |
assertSelectedLabels |
assertSelectedValue |
assertSelectedValues |
assertSomethingSelected |
assertSpeed |
assertTable |
assertText |
assertTextNotPresent |
assertTextPresent |
assertTitle |
assertValue |
assertVisible |
assertWhetherThisFrameMatchFrameExpression |
assertWhetherThisWindowMatchWindowExpression |
assertXpathCount |
assignId |
assignIdAndWait |
break |
captureEntirePageScreenshot |
captureEntirePageScreenshotAndWait |
check |
checkAndWait |
chooseCancelOnNextConfirmation |
chooseOkOnNextConfirmation |
chooseOkOnNextConfirmationAndWait |
click |
clickAndWait |
clickAt |
clickAtAndWait |
close |
contextMenu |
contextMenuAndWait |
contextMenuAt |
contextMenuAtAndWait |
controlKeyDown |
controlKeyDownAndWait |
controlKeyUp |
controlKeyUpAndWait |
createCookie |
createCookieAndWait |
deleteAllVisibleCookies |
deleteAllVisibleCookiesAndWait |
deleteCookie |
deleteCookieAndWait |
deselectPopUp |
deselectPopUpAndWait |
doubleClick |
doubleClickAndWait |
doubleClickAt |
doubleClickAtAndWait |
dragAndDrop |
dragAndDropAndWait |
dragAndDropToObject |
dragAndDropToObjectAndWait |
dragdrop |
dragdropAndWait |
echo |
fireEvent |
fireEventAndWait |
focus |
focusAndWait |
goBack |
goBackAndWait |
highlight |
highlightAndWait |
ignoreAttributesWithoutValue |
ignoreAttributesWithoutValueAndWait |
keyDown |
keyDownAndWait |
keyPress |
keyPressAndWait |
keyUp |
keyUpAndWait |
metaKeyDown |
metaKeyDownAndWait |
metaKeyUp |
metaKeyUpAndWait |
mouseDown |
mouseDownAndWait |
mouseDownAt |
mouseDownAtAndWait |
mouseDownRight |
mouseDownRightAndWait |
mouseDownRightAt |
mouseDownRightAtAndWait |
mouseMove |
mouseMoveAndWait |
mouseMoveAt |
mouseMoveAtAndWait |
mouseOut |
mouseOutAndWait |
mouseOver |
mouseOverAndWait |
mouseUp |
mouseUpAndWait |
mouseUpAt |
mouseUpAtAndWait |
mouseUpRight |
mouseUpRightAndWait |
mouseUpRightAt |
mouseUpRightAtAndWait |
open |
openWindow |
openWindowAndWait |
pause |
refresh |
refreshAndWait |
removeAllSelections |
removeAllSelectionsAndWait |
removeScript |
removeScriptAndWait |
removeSelection |
removeSelectionAndWait |
rollup |
rollupAndWait |
runScript |
runScriptAndWait |
select |
selectAndWait |
selectFrame |
selectPopUp |
selectPopUpAndWait |
selectWindow |
sendKeys |
setBrowserLogLevel |
setBrowserLogLevelAndWait |
setCursorPosition |
setCursorPositionAndWait |
setMouseSpeed |
setMouseSpeedAndWait |
setSpeed |
setSpeedAndWait |
setTimeout |
shiftKeyDown |
shiftKeyDownAndWait |
shiftKeyUp |
shiftKeyUpAndWait |
store |
storeAlert |
storeAlertPresent |
storeAllButtons |
storeAllFields |
storeAllLinks |
storeAllWindowIds |
storeAllWindowNames |
storeAllWindowTitles |
storeAttribute |
storeAttributeFromAllWindows |
storeBodyText |
storeChecked |
storeConfirmation |
storeConfirmationPresent |
storeCookie |
storeCookieByName |
storeCookiePresent |
storeCursorPosition |
storeEditable |
storeElementHeight |
storeElementIndex |
storeElementPositionLeft |
storeElementPositionTop |
storeElementPresent |
storeElementWidth |
storeEval |
storeExpression |
storeHtmlSource |
storeLocation |
storeMouseSpeed |
storeOrdered |
storePrompt |
storePromptPresent |
storeSelectOptions |
storeSelectedId |
storeSelectedIds |
storeSelectedIndex |
storeSelectedIndexes |
storeSelectedLabel |
storeSelectedLabels |
storeSelectedValue |
storeSelectedValues |
storeSomethingSelected |
storeSpeed |
storeTable |
storeText |
storeTextPresent |
storeTitle |
storeValue |
storeVisible |
storeWhetherThisFrameMatchFrameExpression |
storeWhetherThisWindowMatchWindowExpression |
storeXpathCount |
submit |
submitAndWait |
type |
typeAndWait |
typeKeys |
typeKeysAndWait |
uncheck |
uncheckAndWait |
useXpathLibrary |
useXpathLibraryAndWait |
verifyAlert |
verifyAlertNotPresent |
verifyAlertPresent |
verifyAllButtons |
verifyAllFields |
verifyAllLinks |
verifyAllWindowIds |
verifyAllWindowNames |
verifyAllWindowTitles |
verifyAttribute |
verifyAttributeFromAllWindows |
verifyBodyText |
verifyChecked |
verifyConfirmation |
verifyConfirmationNotPresent |
verifyConfirmationPresent |
verifyCookie |
verifyCookieByName |
verifyCookieNotPresent |
verifyCookiePresent |
verifyCursorPosition |
verifyEditable |
verifyElementHeight |
verifyElementIndex |
verifyElementNotPresent |
verifyElementPositionLeft |
verifyElementPositionTop |
verifyElementPresent |
verifyElementWidth |
verifyEval |
verifyExpression |
verifyHtmlSource |
verifyLocation |
verifyMouseSpeed |
verifyNotAlert |
verifyNotAllButtons |
verifyNotAllFields |
verifyNotAllLinks |
verifyNotAllWindowIds |
verifyNotAllWindowNames |
verifyNotAllWindowTitles |
verifyNotAttribute |
verifyNotAttributeFromAllWindows |
verifyNotBodyText |
verifyNotChecked |
verifyNotConfirmation |
verifyNotCookie |
verifyNotCookieByName |
verifyNotCursorPosition |
verifyNotEditable |
verifyNotElementHeight |
verifyNotElementIndex |
verifyNotElementPositionLeft |
verifyNotElementPositionTop |
verifyNotElementWidth |
verifyNotEval |
verifyNotExpression |
verifyNotHtmlSource |
verifyNotLocation |
verifyNotMouseSpeed |
verifyNotOrdered |
verifyNotPrompt |
verifyNotSelectOptions |
verifyNotSelectedId |
verifyNotSelectedIds |
verifyNotSelectedIndex |
verifyNotSelectedIndexes |
verifyNotSelectedLabel |
verifyNotSelectedLabels |
verifyNotSelectedValue |
verifyNotSelectedValues |
verifyNotSomethingSelected |
verifyNotSpeed |
verifyNotTable |
verifyNotText |
verifyNotTitle |
verifyNotValue |
verifyNotVisible |
verifyNotWhetherThisFrameMatchFrameExpression |
verifyNotWhetherThisWindowMatchWindowExpression |
verifyNotXpathCount |
verifyOrdered |
verifyPrompt |
verifyPromptNotPresent |
verifyPromptPresent |
verifySelectOptions |
verifySelectedId |
verifySelectedIds |
verifySelectedIndex |
verifySelectedLabel |
verifySelectedLabels |
verifySelectedValue |
verifySelectedValues |
verifySomethingSelected |
verifySpeed |
verifyTable |
verifyText |
verifyTextNotPresent |
verifyTextPresent |
verifyTitle |
verifyValue |
verifyVisible |
verifyWhetherThisFrameMatchFrameExpression |
verifyWhetherThisWindowMatchWindowExpression |
verifyXpathCount |
waitForAlert |
waitForAlertNotPresent |
waitForAlertPresent |
waitForAllButtons |
waitForAllFields |
waitForAllLinks |
waitForAllWindowIds |
waitForAllWindowNames |
waitForAllWindowTitles |
waitForAttribute |
waitForAttributeFromAllWindows |
waitForBodyText |
waitForChecked |
waitForCondition |
waitForConfirmation |
waitForConfirmationNotPresent |
waitForConfirmationPresent |
waitForCookie |
waitForCookieByName |
waitForCookieNotPresent |
waitForCookiePresent |
waitForCursorPosition |
waitForEditable |
waitForElementHeight |
waitForElementIndex |
waitForElementNotPresent |
waitForElementPositionLeft |
waitForElementPositionTop |
waitForElementPresent |
waitForElementWidth |
waitForEval |
waitForExpression |
waitForFrameToLoad |
waitForHtmlSource |
waitForLocation |
waitForMouseSpeed |
waitForNotAlert |
waitForNotAllButtons |
waitForNotAllFields |
waitForNotAllLinks |
waitForNotAllWindowIds |
waitForNotAllWindowNames |
waitForNotAllWindowTitles |
waitForNotAttribute |
waitForNotAttributeFromAllWindows |
waitForNotBodyText |
waitForNotChecked |
waitForNotConfirmation |
waitForNotCookie |
waitForNotCookieByName |
waitForNotCursorPosition |
waitForNotEditable |
waitForNotElementHeight |
waitForNotElementIndex |
waitForNotElementPositionLeft |
waitForNotElementPositionTop |
waitForNotElementWidth |
waitForNotEval |
waitForNotExpression |
waitForNotHtmlSource |
waitForNotLocation |
waitForNotMouseSpeed |
waitForNotOrdered |
waitForNotPrompt |
waitForNotSelectOptions |
waitForNotSelectedId |
waitForNotSelectedIds |
waitForNotSelectedIndex |
waitForNotSelectedIndexes |
waitForNotSelectedLabel |
waitForNotSelectedLabels |
waitForNotSelectedValue |
waitForNotSelectedValues |
waitForNotSomethingSelected |
waitForNotSpeed |
waitForNotTable |
waitForNotText |
waitForNotTitle |
waitForNotValue |
waitForNotVisible |
waitForNotWhetherThisFrameMatchFrameExpression |
waitForNotWhetherThisWindowMatchWindowExpression |
waitForNotXpathCount |
waitForOrdered |
waitForPageToLoad |
waitForPopUp |
waitForPrompt |
waitForPromptNotPresent |
waitForPromptPresent |
waitForSelectOptions |
waitForSelectedId |
waitForSelectedIds |
waitForSelectedIndex |
waitForSelectedIndexes |
waitForSelectedLabel |
waitForSelectedLabels |
waitForSelectedValue |
waitForSelectedValues |
waitForSomethingSelected |
waitForSpeed |
waitForTable |
waitForText |
waitForTextNotPresent |
waitForTextPresent |
waitForTitle |
waitForValue |
waitForVisible |
waitForWhetherThisFrameMatchFrameExpression |
waitForWhetherThisWindowMatchWindowExpression |
waitForXpathCount |
windowFocus |
windowFocusAndWait |
windowMaximize |
windowMaximizeAndWait |
Subscribe to:
Post Comments (Atom)
Search
Popular Posts
-
Sample Selenium IDE Test Script by Recording: We will use the Mercury Tours website as our web application under test. It is an online flig...
-
Locating GUI Elements Locating elements in WebDriver is done by using the “findElement(By. locator ())” method. The “locator” part of the co...
-
Answer 75 : If you want to see all options available while starting Selenium server then you should use option “-h” while starting Seleni...
-
Answer 60 : While using java you need to create instance of DefaultSelenium class and pass it four parameters – selenium = ne...
-
Answer 51 : Selenium RC is an offering from SeleniumHQ which tries to overcome following draw backs of Selenium IDE – Able to execute...
-
Answer 54 : Selenium core is the core JS engine of Selenium which executes tests on browser, but because of same origin policy it needs t...
-
Answer 18 : You need to use context menu to add check points to your Selenium IDE tests Answer 19 : There are two ways to edit tests...
-
Answer 15 : Yes, you can first record individual test cases and then group all of them in a test suite. Following this entire test suite ...
-
Answer 38 : You could XPath checker - https://addons.mozilla.org/en-US/firefox/addon/xpath-checker/ to test you XPath locators and Fi...
-
Answer 44 : You can change default behavior of Selenium IDE > element locator preference by crating JS file with following– Locato...
Shaik. Powered by Blogger.
0 comments:
Post a Comment