Graphene Implementation 1.0.0.CR3

org.jboss.arquillian.ajocado.framework
Class ExtendedSelenium

java.lang.Object
  extended by com.thoughtworks.selenium.DefaultSelenium
      extended by org.jboss.arquillian.ajocado.framework.ExtendedSelenium
All Implemented Interfaces:
com.thoughtworks.selenium.Selenium

public class ExtendedSelenium
extends com.thoughtworks.selenium.DefaultSelenium

Selenium API extended by useful commands.

Version:
$Revision$
Author:
Lukas Fryc, Pavol Pitonak

Field Summary
 
Fields inherited from class com.thoughtworks.selenium.DefaultSelenium
commandProcessor
 
Constructor Summary
ExtendedSelenium(com.thoughtworks.selenium.CommandProcessor commandProcessor)
           
 
Method Summary
 boolean belongsClass(String locator, String className)
          Checks if element given by locator is member of CSS class given by className.
 void doCommand(String command, String param1, String param2)
           
 Number getJQueryCount(String jqueryLocator)
          Returns the number of elements with given jQuery locator.
 String getStyle(String locator, String property)
          Get current style value of element given by locator.
 boolean isAttributePresent(String elementLocator, String attributeName)
          Verifies that the specified attribute is defined for the element.
 void mouseOutAt(String locator, String coordString)
          Simulates a user hovering a mouse out of the specified element at specific coordinates relative to element.
 void mouseOverAt(String locator, String coordString)
          Simulates a user hovering a mouse over the specified element at specific coordinates relative to element.
 void open(String url)
           
 void scrollIntoView(String locator, String alignToTop)
          Aligns screen to top (resp.
 
Methods inherited from class com.thoughtworks.selenium.DefaultSelenium
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshot, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCssCount, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getEval, getExpression, getHtmlSource, getLocation, getLog, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPress, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForCondition, waitForFrameToLoad, waitForPageToLoad, waitForPopUp, windowFocus, windowMaximize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedSelenium

public ExtendedSelenium(com.thoughtworks.selenium.CommandProcessor commandProcessor)
Method Detail

open

public void open(String url)
Specified by:
open in interface com.thoughtworks.selenium.Selenium
Overrides:
open in class com.thoughtworks.selenium.DefaultSelenium

getStyle

public String getStyle(String locator,
                       String property)
Get current style value of element given by locator. Use CSS style notation instead of JavaScript's camel notation! This methods of getting current style value haven't absolute browser compatibility. E.g.: use property "background-color" instead of "backgroundColor"

Parameters:
locator - of element from what we want to get current style value
property - CSS style property what we can to recognize
Returns:
current value of property if its element exists and has this property value set; null value otherwise
Throws:
IllegalStateException - if is caught unrecognized throwable

scrollIntoView

public void scrollIntoView(String locator,
                           String alignToTop)
Aligns screen to top (resp. bottom) of element given by locator.

Parameters:
locator - of element which should be screen aligned to
alignToTop - should be top border of screen aligned to top border of element

mouseOverAt

public void mouseOverAt(String locator,
                        String coordString)
Simulates a user hovering a mouse over the specified element at specific coordinates relative to element.

Parameters:
locator - element's locator
coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

mouseOutAt

public void mouseOutAt(String locator,
                       String coordString)
Simulates a user hovering a mouse out of the specified element at specific coordinates relative to element.

Parameters:
locator - element's locator
coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

belongsClass

public boolean belongsClass(String locator,
                            String className)
Checks if element given by locator is member of CSS class given by className.

Parameters:
className - name of CSS class
locator - element's locator
Returns:
true if element given by locator is member of CSS class given by className

isAttributePresent

public boolean isAttributePresent(String elementLocator,
                                  String attributeName)
Verifies that the specified attribute is defined for the element.

Parameters:
elementLocator - an element locator
attributeName - a name of an attribute
Returns:
true if the element's attribute is present, false otherwise

getJQueryCount

public Number getJQueryCount(String jqueryLocator)
Returns the number of elements with given jQuery locator.

Parameters:
jqueryLocator - jQuery locator of an element
Returns:
number of found elements

doCommand

public void doCommand(String command,
                      String param1,
                      String param2)

Graphene Implementation 1.0.0.CR3

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.