angularjs - element not set with try catch in protractor? -
I am writing a launcher test for my angular JS webpage. There is a jsonfile that I am using to fill data on the page. The statement of the attempt will discover the element in which the property of the model is:
var data = {name: 'James', address: '11 Sussex Street'}; (Key in data) {try {var el = element (by.model ('name')); If (el.isElementPresent ()) {el.clear () SendKeys (data [key]); }} Hold (error) {console.log ('error occurred', mistake); }}
When I run the trial, I get an error:
Type error: the property can not be read 'Elements Override' Undefined
Has an element of the name but is not set?
Try it instead
var el = element (by Model ('name')); El.isPresent (). Then (function (present) {if (elongated) {el.clear (.) SendKeys ('James');}}) Catch (err) {console.log ('error occured', err); }
Comments
Post a Comment