public abstract class By
extends java.lang.Object
implements java.io.Serializable
In release 5.0.1, Robotium was refactored to use com.robotium.solo package
Example of usage:
At controller side, user can simply call xpath(String)
etc. to get a By instance 'by'.
and send this object thru the wire.
At the device side, we receive that object 'by' and we call toSoloBy()
to get a Solo's By object, which can be used by Robotium's APIs.
This class copy the content of com.robotium.solo.By, if that class is modified, we needs
to update this class also.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
By.ClassName |
(package private) static class |
By.CssSelector |
(package private) static class |
By.Id |
(package private) static class |
By.Name |
(package private) static class |
By.TagName |
(package private) static class |
By.Text |
(package private) static class |
By.Xpath |
Constructor and Description |
---|
By() |
Modifier and Type | Method and Description |
---|---|
static By |
className(java.lang.String className)
Select a WebElement by its class name.
|
static By |
cssSelector(java.lang.String selectors)
Select a WebElement by its css selector.
|
abstract java.lang.String |
getStaticMethodName()
Return the name of static method for creating a By instance.
|
java.lang.String |
getValue()
Returns the value.
|
static By |
id(java.lang.String id)
Select a WebElement by its id.
|
static By |
name(java.lang.String name)
Select a WebElement by its name.
|
static By |
tagName(java.lang.String tagName)
Select a WebElement by its tag name.
|
static By |
textContent(java.lang.String textContent)
Select a WebElement by its text content.
|
java.lang.Object |
toSoloBy()
Convert this class to com.jayway.android.robotium.solo.By with help of reflection.
It is not suggested to call this method frequently. |
static By |
xpath(java.lang.String xpath)
Select a WebElement by its xpath.
|
public static By id(java.lang.String id)
id
- the id of the web elementpublic static By xpath(java.lang.String xpath)
xpath
- the xpath of the web elementpublic static By cssSelector(java.lang.String selectors)
selectors
- the css selector of the web elementpublic static By name(java.lang.String name)
name
- the name of the web elementpublic static By className(java.lang.String className)
className
- the class name of the web elementpublic static By textContent(java.lang.String textContent)
textContent
- the text content of the web elementpublic static By tagName(java.lang.String tagName)
tagName
- the tag name of the web elementpublic java.lang.String getValue()
public abstract java.lang.String getStaticMethodName()
public java.lang.Object toSoloBy()
Copyright © SAS Institute. All Rights Reserved.