Wd.js is incrementally implementing the Mobile JsonWire Protocol Spec
Find elements in iOS applications using the UIAutomation Javascript API
eg:
wd.elementsByIosUIAutomation('.tableViews()[0].cells()', function(err, el){
el.elementByIosUIAutomation('.elements()["UICatalog"]', function(err, el){
el.getAttribute('name', function(err, name){
console.log(name);
});
});
});
Find elements in iOS applications using the WebDriverAgent Class Chain API
eg:
wd.elementsByIosClassChain('XCUIElementTypeWindow/XCUIElementTypeAny[`value == "bla1" OR label == "bla2"`]', function(err, el){
el.getAttribute('name', function(err, name){
console.log(name);
});
});
Find elements in iOS applications using the WebDriverAgent Predicate API
eg:
wd.elementsByIosPredicateString('type IN {`XCUIElementTypeIcon`,`XCUIElementTypeImage`} AND visible == 1', function(err, el){
el.getAttribute('name', function(err, name){
console.log(name);
});
});
Find elements in android applications using the UiSelector Class
eg:
wd.elementsByAndroidUIAutomator('new UiSelector().clickable(true)', function(err, els){
console.log("number of clickable elements:", els.length);
});
Find elements by whatever identifier is used by the platforms Accessibility framework.
eg:
wd.elementByAccessibilityId("Submit", function(err, el){
el.click();
});