Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.

Similar presentations


Presentation on theme: "Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel."— Presentation transcript:

1 Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel

2 2 Day 2 Overview of Selenese Commonly Used Commands

3  Action: Performs an operation on the GUI, or retrieves values from the GUI  click, type, check, keyDown, etc.  Verification: performs validation of an expected result, and returns true/false  verifyTextPresent, verifyTitle, verifyElementPresent, etc.  Assertion: performs validation of a required precondition, and terminates the test if false is returned.  assertTitle, assertValue, assertVisible, etc. 3

4 There are three types of action commands:  Simple actions: perform an operation  “Wait” actions: perform an operation and pause the test execution until a condition is met or an event occurs  clickAndWait, clickAtAndWait, waitForElementPresent, waitForVisable  “Store” actions: retrieve and store output in variables  storeText, storeValue, storeEval 4

5 Efficient way to manage failures  If you’re not on the correct page, you’ll probably want to abort your test case so that you can investigate the cause and fix the issue(s) promptly. Best use of this feature is to logically group test commands  Start each group with an “assert” followed by one or more “verify” test commands 5

6 During recording…  Right-click an element to open the context menu  Scroll to the bottom of the context menu and select the “Show All Available Commands” menu item. 6 Items will vary depending on the element clicked

7 When Debugging…  Click the row to edit  In the command field, begin typing text. 7 ALL existing commands (beginning from entered text) are displayed in alphabetical order.

8 8 All commands can be split in to 12 command groups:  Selenium Control  Browser Operations  Cookie Operations  Popup Box Operations  Checkbox & Radio Buttons  Lists & Dropdowns  Edit Fields  Keyboard Operations  Mouse Operations  Form Operations  Windows/Element Selection  Selenium Accessors

9 Manipulate the Selenium environment, including recording and playback 9 CommandParameter 1Parameter 2 setTimeoutmilliseconds setMouseSpeed*number of pixels setSpeed*milliseconds addLocationStrategy*strategyNamefunctionDef allowNativeXpath*boolean ignoreAttributesWithoutValue*boolean assignId*locatoridentifier captureEntirePageScreenShot*filename, kwargs * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

10 CommandParameter 1Parameter 2 echomessage pausemilliseconds runScript*javascript fireEvent*locatoreventName waitForConditionjavascriptmilliseconds waitForPageToLoadmilliseconds waitForPopUpwindowIDmilliseconds 10 * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

11 CommandParameter 1Parameter 2 select*locatoroptionLocator selectFramelocator selectWindowwindowID focus*locator highlight*locator windowFocus* windowMaximize* 11 * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

12 CommandParameter 1Parameter 2 open*url openWindow*urlwindowID goBack* refresh* close setBrowserLogLevel*logLevel 12 * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

13 CommandParameter 1Parameter 2 createCookie*nameValuePairoptionString deleteCookie*nameoptionString deleteAllVisibleCookies* 13 CommandParameter 1Parameter 2 answerOnNextPromptanswer chooseCancelOnNextConfirmation chooseOkOnNextConfirmation * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

14 CommandParameter 1Parameter 2 check*locator uncheck*locator 14 CommandParameter 1Parameter 2 addSelection*locatoroptionLocator removeSelection*locatoroptionLocator removeAllSelections*locator * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

15 CommandParameter 1Parameter 2 type*locatorvalue typeKeys*locatorvalue setCursorPosition*locatorposition 15 CommandParameter 1Parameter 2 submit*formLocator * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

16 CommandParameter 1Parameter 2 keyDown*locatorkeySequence keyPress*locatorkeySequence keyUp*locatorkeySequence altKeyDown* altKeyUp* controlKeyDown* controlKeyUp* metaKeyDown* metaKeyUp* shiftKeyDown* shiftKeyUp* 16 * Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

17 CommandParameter 1Parameter 2 click*locator doubleClick*locator contextMenu*locator mouseDown*locator mouseMove*locator mouseOut*locator mouseUp*locator dragAndDrop*locatormovementString dragAndDropToObject*sourceLocatordestLocator 17 * - Selenium operations which also have comparable *AndWait command. Example: click and clickAndWait

18 CommandParameter 1Parameter 2 clickAt*locatorcoordString doubleClickAt*locatorcoordString contextMenuAt*locatorcoordString mouseDownAt*locatorcoordString mouseMoveAt*locatorcoordString mouseOver*locatorcoordString mouseUpAt*locatorcoordString 18 * - Selenium operations which also have comparable *AndWait command. Example: click and claickAndWait

19  A list of Selenese commands can be found at: http://release.seleniumhq.org/selenium-core/0.8.0/reference.html http://release.seleniumhq.org/selenium-core/0.8.0/reference.html 19


Download ppt "Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel."

Similar presentations


Ads by Google