use of android.support.test.espresso.PerformException in project appium-espresso-driver by appium.
the class SendKeys method handle.
@Override
@Nullable
public Void handle(TextParams params) throws AppiumException {
String id = params.getElementId();
ViewInteraction viewInteraction = Element.getById(id);
// Convert the array of text to a String
String[] textArray = params.getValue();
StringBuilder stringBuilder = new StringBuilder();
for (String text : textArray) {
stringBuilder.append(text);
}
String textValue = stringBuilder.toString();
try {
viewInteraction.perform(typeText(textValue));
} catch (PerformException e) {
throw new AppiumException("Could not apply sendKeys to element " + id + ": " + e.getMessage());
}
return null;
}
Aggregations