1

My goal:

Select value from dropdown non-angular

My Problem:

I'm not finding on the internet any valid option to select an option in a dropdown for non-angular apps

My dropdown

<select class="form-control" name="seller" required="" onchange="location.href='/dashboard/listings/add?seller='+$(this).val()">
    <option value="">Choose...</option>
    <option value="588a82ec516f550400407f05">a (rafael@rafael.com)</option>
</select>
Rafael C.
  • 2,245
  • 4
  • 29
  • 45

1 Answers1

0

If you apply the "Select -> Option" helper abstraction introduced here, you can do it this way:

var SelectWrapper  = require('select-wrapper');
var seller = new SelectWrapper(by.name('seller'));

seller.selectByPartialText('rafael@rafael.com');

Or, if doing it directly using the by.name() and by.cssContainingText() locators:

var seller = element(by.name('seller'));
seller.element(by.cssContainingText("option", "rafael@rafael.com")).click();
Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195