O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

More Appium testing

I wanted to include one more test (not used in this application) that I have written in the past for a different project since this will give you an idea of just how powerful Appium can be:

it("should type in an element", function (done) {  driver  .elementByXPath('//' + nsAppium.getXPathElement("EditText") + "[@text='Enter your name']")   .sendKeys('Testing')  .text()  .then(function (v) {     if ('Testing' !== v) {        done(new Error("Value in name field does not match"));     } else {        done();     }   }, done); });});

The first thing you might note is that I did not return the promise chain. That is because this example shows how to use the asynchronous support of it. For an async support, you can use a promise or make the function coming ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required