0

Following is the AngularJS Code that I have used for Test Automation for a Web Application using Protractor... for example I want to click on dropdown item 3 and verfiy that I have selected option 3.

How should I do it ? The code doesn't show any error. I'm trying to automate using Angular JS

function seldrop(element, optionNum) {
   console.log('in seldrop');
var selectDropdownbyNum = function ( element, optionNum ) {

if (optionNum){
var options = element.querySelectorAll('.dropdown-toggle')   
  .then(function(options){
    options[optionNum].click();

  });
 }
 }
 }
 it('put in values', function() {

    const selector = seldrop(element,'3');
    console.log('\n ✓ element selected') }});


 });
  • 2
    Can you please provide the HTML, if possible a JSFiddle with the issue? – Naren Murali Sep 07 '17 at 18:31
  • Possible duplicate of [How to set a selected option of a dropdown list control using angular JS](https://stackoverflow.com/questions/17968760/how-to-set-a-selected-option-of-a-dropdown-list-control-using-angular-js) – Vamsi Sep 08 '17 at 04:53
  • This is for test automation using protractor. the possible answers has been tried and didnt work. – Indu Shreenath Sep 08 '17 at 07:27

0 Answers0