angularjs - New to Protractor and difficulty with collecting Select options -


self teaching protractor , fighting issues of non angular web app , getting list of values out of select control. here html can't seem validate list. (first weight select box @ site)

http://halls.md/body-surface-area/bsa.htm

and failed syntax. script executes referencing element , option can't correctly evaluate capture of option values in list:

var tempstr = browser.driver.findelement(by.xpath('//select[@name="wu"]'));  //get options   var tempstrs = tempstr.findelements(by.tagname('option'));   console.log(tempstrs[1]); 

first of all, use element notation - @ least cleaner.

if want see option text or value on console, need resolve promises:

var weightunitselect = element(by.name("wu")); var options = weightunitselect.all(by.tagname("option"));  options.first().gettext().then(function (text) {     console.log(text); }); 

also, recommend abstract select->option html constructions of answer:


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -