Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.31 KB

jsonwire-mobile.md

File metadata and controls

41 lines (31 loc) · 1.31 KB

Mobile JsonWire Protocol Methods

Wd.js is incrementally implementing the Mobile JsonWire Protocol Spec

-ios uiautomation Locator Strategy

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);
    });
  });
});

-android uiautomator Locator Strategy

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);
});

accessibility id

Find elements by whatever identifier is used by the platforms Accessibility framework.

eg:

wd.elementByAccessibilityId("Submit", function(err, el){
  el.click();
});