add Ruby and Python examples
MODIFY
docs/en/writing-running-appium/android/espresso-datamatcher-selector.md
docs/en/writing-running-appium/android/espresso-datamatcher-selector.md
@@ -67,6 +67,26 @@ driver.findElementById("list")
.click();
```
+```ruby
+# Ruby
+@driver.find_element(:id, 'list')
+ .find_element(:data_matcher, {
+ name: 'hasEntry',
+ args: ['title', 'TextClock']
+ }.to_json)
+ .click
+```
+
+```python
+# Python
+driver.find_element_by_id('list')
+ .find_element_by_android_data_matcher({
+ name='hasEntry',
+ args=['title', 'TextClock']
+ })
+ .click()
+```
+
This Appium selector is equivalent to writing this matcher in Espresso:
```java
@@ -88,6 +108,22 @@ driver.findElement("-android datamatcher", JSON.stringify({
.click();
```
+```ruby
+# Ruby
+@driver.find_element(:data_matcher, {
+ name: 'hasEntry',
+ args: ['title', 'TextClock']
+}.to_json).click
+```
+
+```python
+# Python
+driver.find_element_by_android_data_matcher({
+ name='hasEntry',
+ args=['title', 'TextClock']
+}).click()
+```
+
### Writing the Selector
The data matcher selector uses Java reflection to invoke a [Hamcrest matcher](http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html) that's used to locate the adapter object. The matcher is in JSON format and has this format

add Ruby and Python examples (#12427)