docs: fix java command examples
MODIFY
commands-yml/commands/element/attributes/attribute.yml
commands-yml/commands/element/attributes/attribute.yml
@@ -5,7 +5,7 @@ short_description: Get the value of an element's attribute
example_usage:
java:
|
- List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+ MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
String tagName = element.getAttribute("content-desc");
python:
|

MODIFY
commands-yml/commands/element/attributes/css-property.yml
commands-yml/commands/element/attributes/css-property.yml
@@ -11,7 +11,7 @@ description:
example_usage:
java:
|
- List<MobileElement> element = (MobileElement) driver.findElementById("SomeId");
+ MobileElement element = (MobileElement) driver.findElementById("SomeId");
String cssProperty = element.getCssValue("style");
python:
|

MODIFY
commands-yml/commands/element/attributes/location.yml
commands-yml/commands/element/attributes/location.yml
@@ -7,7 +7,7 @@ description: The point (0, 0) refers to the upper-left corner of the page. The e
example_usage:
java:
|
- List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+ MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
Point location = element.getLocation();
python:
|

MODIFY
commands-yml/commands/element/attributes/name.yml
commands-yml/commands/element/attributes/name.yml
@@ -5,7 +5,7 @@ short_description: Get an element's tag name
example_usage:
java:
|
- List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+ MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
String tagName = element.getTagName();
python:
|

MODIFY
commands-yml/commands/element/attributes/rect.yml
commands-yml/commands/element/attributes/rect.yml
@@ -5,7 +5,7 @@ short_description: Gets dimensions and coordinates of an element
example_usage:
java:
|
- List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+ MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
Rectangle rect = element.getRect();
python:
|

MODIFY
commands-yml/commands/element/attributes/size.yml
commands-yml/commands/element/attributes/size.yml
@@ -7,7 +7,7 @@ description: The size will be returned as an object with width and height proper
example_usage:
java:
|
- List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+ MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
Dimension elementSize = element.getSize();
python:
|

MODIFY
commands-yml/commands/element/find-elements.yml
commands-yml/commands/element/find-elements.yml
@@ -29,8 +29,8 @@ selector_strategies:
example_usage:
java:
|
- List<MobileElement> elementsOne = (MobileElement) driver.findElementsByAccessibilityId("SomeAccessibilityID");
- List<MobileElement> elementsTwo = (MobileElement) driver.findElementsByClassName("SomeClassName");
+ List<MobileElement> elementsOne = (List<MobileElement>) driver.findElementsByAccessibilityId("SomeAccessibilityID");
+ List<MobileElement> elementsTwo = (List<MobileElement>) driver.findElementsByClassName("SomeClassName");
python:
|
el = self.driver.find_elements_by_accessibility_id('SomeAccessibilityID')

MODIFY
docs/en/commands/element/attributes/attribute.md
docs/en/commands/element/attributes/attribute.md
@@ -7,7 +7,7 @@ Get the value of an element's attribute
```java
// Java
-List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
String tagName = element.getAttribute("content-desc");
```

MODIFY
docs/en/commands/element/attributes/css-property.md
docs/en/commands/element/attributes/css-property.md
@@ -7,7 +7,7 @@ Query the value of a web element's computed CSS property
```java
// Java
-List<MobileElement> element = (MobileElement) driver.findElementById("SomeId");
+MobileElement element = (MobileElement) driver.findElementById("SomeId");
String cssProperty = element.getCssValue("style");
```

MODIFY
docs/en/commands/element/attributes/location.md
docs/en/commands/element/attributes/location.md
@@ -7,7 +7,7 @@ Determine an element's location on the page or screen
```java
// Java
-List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
Point location = element.getLocation();
```

MODIFY
docs/en/commands/element/attributes/name.md
docs/en/commands/element/attributes/name.md
@@ -7,7 +7,7 @@ Get an element's tag name
```java
// Java
-List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
String tagName = element.getTagName();
```

MODIFY
docs/en/commands/element/attributes/rect.md
docs/en/commands/element/attributes/rect.md
@@ -7,7 +7,7 @@ Gets dimensions and coordinates of an element
```java
// Java
-List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
Rectangle rect = element.getRect();
```

MODIFY
docs/en/commands/element/attributes/size.md
docs/en/commands/element/attributes/size.md
@@ -7,7 +7,7 @@ Determine an element's size in pixels
```java
// Java
-List<MobileElement> element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
+MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");
Dimension elementSize = element.getSize();
```

MODIFY
docs/en/commands/element/find-elements.md
docs/en/commands/element/find-elements.md
@@ -7,8 +7,8 @@ Search for multiple elements
```java
// Java
-List<MobileElement> elementsOne = (MobileElement) driver.findElementsByAccessibilityId("SomeAccessibilityID");
-List<MobileElement> elementsTwo = (MobileElement) driver.findElementsByClassName("SomeClassName");
+List<MobileElement> elementsOne = (List<MobileElement>) driver.findElementsByAccessibilityId("SomeAccessibilityID");
+List<MobileElement> elementsTwo = (List<MobileElement>) driver.findElementsByClassName("SomeClassName");
```

docs: fix java command examples (#12923)