Nightwatch / Selenium and Promises -


is possible wait webdriver/selenium input on javascript side? i've got following code nightwatch.js

getprogrammlinks: function() { let self = this; // well. return new promise(function(resolve, reject) {   var links = [];    self.api.elements('css selector', 'a[role=button]', function(elements) {     if (elements.state == 'success') {       (itemid in elements.value) {         self.api.elementidattribute(itemid, 'href', function(item) {           if (item.state == 'success') {             if (item.value.includes('programm')) {               links.push(item.value);             }           } else {             reject(item);           }         })       }       resolve(links); // after items have been processed     } else {       reject(elements);     }   }); }); } 

anyhow never links when using getprogrammlinks().then(function(links) {}); , seems stop after first iteration of itemid (it pushes links once (or runs if statement). appreciated


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -