io.selendroid.server.model.internal
Class AbstractWebElementContext

java.lang.Object
  extended by io.selendroid.server.model.internal.AbstractWebElementContext
All Implemented Interfaces:
FindsByClass, FindsById, FindsByName, FindsByPartialText, FindsByTagName, FindsByText, FindsByXPath, SearchContext
Direct Known Subclasses:
DefaultSelendroidDriver.WebviewSearchScope

public abstract class AbstractWebElementContext
extends Object
implements SearchContext, FindsByTagName, FindsByName, FindsById, FindsByText, FindsByXPath, FindsByPartialText, FindsByClass


Field Summary
protected  SelendroidWebDriver driver
           
protected  KnownElements knownElements
           
protected static String LOCATOR_CLASS_NAME
           
protected static String LOCATOR_CSS_SELECTOR
           
protected static String LOCATOR_ID
           
protected static String LOCATOR_LINK_TEXT
           
protected static String LOCATOR_NAME
           
protected static String LOCATOR_PARTIAL_LINK_TEXT
           
protected static String LOCATOR_TAG_NAME
           
protected static String LOCATOR_XPATH
           
protected  android.webkit.WebView view
           
 
Constructor Summary
AbstractWebElementContext(KnownElements knownElements, android.webkit.WebView webview, SelendroidWebDriver driver)
           
 
Method Summary
 AndroidElement findElement(By by)
          Find the first AndroidElement using the given method.
 AndroidElement findElementByClass(String using)
           
 AndroidElement findElementByCssSelector(String using)
           
 AndroidElement findElementById(String id)
           
 AndroidElement findElementByName(String using)
           
 AndroidElement findElementByPartialText(String using)
           
 AndroidElement findElementByTagName(String using)
           
 AndroidElement findElementByText(String using)
           
 AndroidElement findElementByXPath(String using)
           
 List<AndroidElement> findElements(By by)
          Find all elements within the current context using the given mechanism.
 List<AndroidElement> findElementsByClass(String using)
           
 List<AndroidElement> findElementsByCssSelector(String using)
           
 List<AndroidElement> findElementsById(String id)
           
 List<AndroidElement> findElementsByName(String using)
           
 List<AndroidElement> findElementsByPartialText(String using)
           
 List<AndroidElement> findElementsByTagName(String using)
           
 List<AndroidElement> findElementsByText(String using)
           
 List<AndroidElement> findElementsByXPath(String using)
           
 AndroidWebElement getElementTree()
           
protected abstract  AndroidElement lookupElement(String strategy, String locator)
           
protected abstract  List<AndroidElement> lookupElements(String strategy, String locator)
           
 AndroidWebElement newAndroidWebElementById(String id)
           
protected  AndroidElement replyElement(org.json.JSONObject result)
           
protected  List<AndroidElement> replyElements(org.json.JSONArray result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATOR_ID

protected static final String LOCATOR_ID
See Also:
Constant Field Values

LOCATOR_LINK_TEXT

protected static final String LOCATOR_LINK_TEXT
See Also:
Constant Field Values

LOCATOR_PARTIAL_LINK_TEXT

protected static final String LOCATOR_PARTIAL_LINK_TEXT
See Also:
Constant Field Values

LOCATOR_NAME

protected static final String LOCATOR_NAME
See Also:
Constant Field Values

LOCATOR_TAG_NAME

protected static final String LOCATOR_TAG_NAME
See Also:
Constant Field Values

LOCATOR_XPATH

protected static final String LOCATOR_XPATH
See Also:
Constant Field Values

LOCATOR_CSS_SELECTOR

protected static final String LOCATOR_CSS_SELECTOR
See Also:
Constant Field Values

LOCATOR_CLASS_NAME

protected static final String LOCATOR_CLASS_NAME
See Also:
Constant Field Values

knownElements

protected KnownElements knownElements

view

protected volatile android.webkit.WebView view

driver

protected SelendroidWebDriver driver
Constructor Detail

AbstractWebElementContext

public AbstractWebElementContext(KnownElements knownElements,
                                 android.webkit.WebView webview,
                                 SelendroidWebDriver driver)
Method Detail

replyElements

protected List<AndroidElement> replyElements(org.json.JSONArray result)

replyElement

protected AndroidElement replyElement(org.json.JSONObject result)

newAndroidWebElementById

public AndroidWebElement newAndroidWebElementById(String id)

getElementTree

public AndroidWebElement getElementTree()

findElements

public List<AndroidElement> findElements(By by)
Description copied from interface: SearchContext
Find all elements within the current context using the given mechanism.

Specified by:
findElements in interface SearchContext
Parameters:
by - The locating mechanism to use
Returns:
A list of all AndroidElements, or an empty list if nothing matches
See Also:
org.openqa.selenium.By

findElement

public AndroidElement findElement(By by)
Description copied from interface: SearchContext
Find the first AndroidElement using the given method.

Specified by:
findElement in interface SearchContext
Parameters:
by - The locating mechanism
Returns:
The first matching element on the current context

findElementById

public AndroidElement findElementById(String id)
Specified by:
findElementById in interface FindsById

findElementsById

public List<AndroidElement> findElementsById(String id)
Specified by:
findElementsById in interface FindsById

findElementByTagName

public AndroidElement findElementByTagName(String using)
Specified by:
findElementByTagName in interface FindsByTagName

findElementByPartialText

public AndroidElement findElementByPartialText(String using)
Specified by:
findElementByPartialText in interface FindsByPartialText

findElementsByPartialText

public List<AndroidElement> findElementsByPartialText(String using)
Specified by:
findElementsByPartialText in interface FindsByPartialText

findElementsByTagName

public List<AndroidElement> findElementsByTagName(String using)
Specified by:
findElementsByTagName in interface FindsByTagName

findElementByText

public AndroidElement findElementByText(String using)
Specified by:
findElementByText in interface FindsByText

findElementsByText

public List<AndroidElement> findElementsByText(String using)
Specified by:
findElementsByText in interface FindsByText

findElementByXPath

public AndroidElement findElementByXPath(String using)
Specified by:
findElementByXPath in interface FindsByXPath

findElementsByXPath

public List<AndroidElement> findElementsByXPath(String using)
Specified by:
findElementsByXPath in interface FindsByXPath

findElementByCssSelector

public AndroidElement findElementByCssSelector(String using)

findElementsByCssSelector

public List<AndroidElement> findElementsByCssSelector(String using)

findElementByName

public AndroidElement findElementByName(String using)
Specified by:
findElementByName in interface FindsByName

findElementsByName

public List<AndroidElement> findElementsByName(String using)
Specified by:
findElementsByName in interface FindsByName

findElementByClass

public AndroidElement findElementByClass(String using)
Specified by:
findElementByClass in interface FindsByClass

findElementsByClass

public List<AndroidElement> findElementsByClass(String using)
Specified by:
findElementsByClass in interface FindsByClass

lookupElement

protected abstract AndroidElement lookupElement(String strategy,
                                                String locator)

lookupElements

protected abstract List<AndroidElement> lookupElements(String strategy,
                                                       String locator)


Copyright © 2014. All rights reserved.