I am a beginner with Appium and I am currently exploring the workshop Git project, which utilizes wd.js and Grunt. From my research in the documentation and forums, I have learned that there are two methods for accessing the text of native elements within my mocha specs.
The first method:
it('should be able to do stuff', function (done) {
this.driver
.elementsByClassName('android.widget.EditText').at(0)
.sendKeys('Test')
.text().should.eventually.equal('Test')
.nodeify(done);
});
The second method:
it('should be able to do stuff', function (done) {
this.driver
.waitForElementByCss("#my-id" , 2000, function(err, el) {
el.text(function(err, text) { text.should.equal('Test'); });
})
.nodeify(done);
});
I am curious about how I can store the text of any found element in a variable.