javascript - How to Iterated through and select each Drop down values in protractor -
i have scenario there 2 dropdowns each having value , there add button. need select 1 value 1 dropdown , 1 value other dropdown, click on add button , again select value both dropdown. however, when select value of 1 dropdown throws me error message -
element not clickable @ time
below code:
activitypage.activitiestab.click() browser.driver.sleep(2000); activitypage.newactivity.click(); browser.driver.sleep(2000); activitypage.entitydropdown.click(); browser.driver.sleep(2000); activitypage.entiteslist(function (items) { (var = 1; < items.length; ++i) { items[i].click() browser.driver.sleep(2000); activitypage.activitydropdown.click() activitypage.entiteslist(function (activitiesname) { (var j = 1; j < activitiesname.length; ++j) { activitiesname[j].click(); activitypage.activitydropdown.click() browser.driver.sleep(2000); activitypage.entitydropdown.click(); items[i].click() } }); } });
the issue is, usually, in protractor promise, therefore cannot call things in loop. run loops immediately, not waiting async promise resolving.
here nice answer explains more thoroughly: https://stackoverflow.com/a/27910350/2374517
Comments
Post a Comment