Skip to content

Commit a6f071d

Browse files
User253489barancev
authored andcommitted
Fix issues in Javadocs and exception messages.
Signed-off-by: Alexei Barantsev <barancev@gmail.com>
1 parent 4c359d9 commit a6f071d

File tree

1 file changed

+33
-33
lines changed
  • java/client/src/org/openqa/selenium

1 file changed

+33
-33
lines changed

java/client/src/org/openqa/selenium/By.java

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,105 +45,105 @@
4545
*/
4646
public abstract class By {
4747
/**
48-
* @param id The value of the "id" attribute to search for
49-
* @return a By which locates elements by the value of the "id" attribute.
48+
* @param id The value of the "id" attribute to search for.
49+
* @return A By which locates elements by the value of the "id" attribute.
5050
*/
5151
public static By id(final String id) {
5252
if (id == null)
5353
throw new IllegalArgumentException(
54-
"Cannot find elements with a null id attribute.");
54+
"Cannot find elements when the id is null.");
5555

5656
return new ById(id);
5757
}
5858

5959
/**
60-
* @param linkText The exact text to match against
61-
* @return a By which locates A elements by the exact text it displays
60+
* @param linkText The exact text to match against.
61+
* @return A By which locates A elements by the exact text they display.
6262
*/
6363
public static By linkText(final String linkText) {
6464
if (linkText == null)
6565
throw new IllegalArgumentException(
66-
"Cannot find elements when link text is null.");
66+
"Cannot find elements when the link text is null.");
6767

6868
return new ByLinkText(linkText);
6969
}
7070

7171
/**
72-
* @param linkText The text to match against
73-
* @return a By which locates A elements that contain the given link text
72+
* @param linkText The text to match against.
73+
* @return A By which locates A elements that contain the given text.
7474
*/
7575
public static By partialLinkText(final String linkText) {
7676
if (linkText == null)
7777
throw new IllegalArgumentException(
78-
"Cannot find elements when link text is null.");
78+
"Cannot find elements when the link text is null.");
7979

8080
return new ByPartialLinkText(linkText);
8181
}
8282

8383
/**
84-
* @param name The value of the "name" attribute to search for
85-
* @return a By which locates elements by the value of the "name" attribute.
84+
* @param name The value of the "name" attribute to search for.
85+
* @return A By which locates elements by the value of the "name" attribute.
8686
*/
8787
public static By name(final String name) {
8888
if (name == null)
8989
throw new IllegalArgumentException(
90-
"Cannot find elements when name text is null.");
90+
"Cannot find elements when the name is null.");
9191

9292
return new ByName(name);
9393
}
9494

9595
/**
96-
* @param name The element's tagName
97-
* @return a By which locates elements by their tag name
96+
* @param name The element's tag name.
97+
* @return A By which locates elements by their tag name.
9898
*/
9999
public static By tagName(final String name) {
100100
if (name == null)
101101
throw new IllegalArgumentException(
102-
"Cannot find elements when name tag name is null.");
102+
"Cannot find elements when the tag name is null.");
103103

104104
return new ByTagName(name);
105105
}
106106

107107
/**
108-
* @param xpathExpression The xpath to use
109-
* @return a By which locates elements via XPath
108+
* @param xpathExpression The XPath to use.
109+
* @return A By which locates elements via XPath.
110110
*/
111111
public static By xpath(final String xpathExpression) {
112112
if (xpathExpression == null)
113113
throw new IllegalArgumentException(
114-
"Cannot find elements when the XPath expression is null.");
114+
"Cannot find elements when the XPath is null.");
115115

116116
return new ByXPath(xpathExpression);
117117
}
118118

119119
/**
120-
* Finds elements based on the value of the "class" attribute. If an element has many classes then
121-
* this will match against each of them. For example if the value is "one two onone", then the
122-
* following "className"s will match: "one" and "two"
120+
* Find elements based on the value of the "class" attribute. If an element has multiple classes, then
121+
* this will match against each of them. For example, if the value is "one two onone", then the
122+
* class names "one" and "two" will match.
123123
*
124-
* @param className The value of the "class" attribute to search for
125-
* @return a By which locates elements by the value of the "class" attribute.
124+
* @param className The value of the "class" attribute to search for.
125+
* @return A By which locates elements by the value of the "class" attribute.
126126
*/
127127
public static By className(final String className) {
128128
if (className == null)
129129
throw new IllegalArgumentException(
130-
"Cannot find elements when the class name expression is null.");
130+
"Cannot find elements when the class name is null.");
131131

132132
return new ByClassName(className);
133133
}
134134

135135
/**
136-
* Finds elements via the driver's underlying W3 Selector engine. If the browser does not
136+
* Find elements via the driver's underlying W3 Selector engine. If the browser does not
137137
* implement the Selector API, a best effort is made to emulate the API. In this case, we strive
138138
* for at least CSS2 support, but offer no guarantees.
139139
*
140-
* @param selector css expression
141-
* @return a By which locates elements by CSS.
140+
* @param selector CSS expression.
141+
* @return A By which locates elements by CSS.
142142
*/
143143
public static By cssSelector(final String selector) {
144144
if (selector == null)
145145
throw new IllegalArgumentException(
146-
"Cannot find elements when the selector is null");
146+
"Cannot find elements when the CSS selector is null.");
147147

148148
return new ByCssSelector(selector);
149149

@@ -152,8 +152,8 @@ public static By cssSelector(final String selector) {
152152
/**
153153
* Find a single element. Override this method if necessary.
154154
*
155-
* @param context A context to use to find the element
156-
* @return The WebElement that matches the selector
155+
* @param context A context to use to find the element.
156+
* @return The WebElement that matches the selector.
157157
*/
158158
public WebElement findElement(SearchContext context) {
159159
List<WebElement> allElements = findElements(context);
@@ -166,8 +166,8 @@ public WebElement findElement(SearchContext context) {
166166
/**
167167
* Find many elements.
168168
*
169-
* @param context A context to use to find the element
170-
* @return A list of WebElements matching the selector
169+
* @param context A context to use to find the elements.
170+
* @return A list of WebElements matching the selector.
171171
*/
172172
public abstract List<WebElement> findElements(SearchContext context);
173173

@@ -394,7 +394,7 @@ public WebElement findElement(SearchContext context) {
394394
}
395395

396396
/**
397-
* Generates a partial xpath expression that matches an element whose specified attribute
397+
* Generate a partial XPath expression that matches an element whose specified attribute
398398
* contains the given CSS word. So to match &lt;div class='foo bar'&gt; you would say "//div[" +
399399
* containingWord("class", "foo") + "]".
400400
*

0 commit comments

Comments
 (0)