Home > database >  Filling in text box with capybara
Filling in text box with capybara

Time:03-25

I have a text box that I'm trying to fill in with Capybara. I've tried to play around with it and try to figure something's out but my tests don't pass.

Here's

It's for this specific text box:

<span  ui-grid-one-bind-id-grid="col.uid   '-header-text'" id="14213131-uiGrid-0008-header-text">DOB</span>

<input type="text"  ng-model="colFilter.term" ng-attr-placeholder="{{colFilter.placeholder || ''}}" aria-label="Filter for column" placeholder="" aria-invalid="false" style="">

Here's the code I have.

find('ui-grid-filter-input ui-grid-filter-input-0 ng-touched').set('1414234')

Ideally I'm trying to find this specific text box and type something in.

CodePudding user response:

To fill the <input> using Capybara you can use either of the following locator strategies:

find('[aria-label=Filter for column]').set('1414234')

or

find('input[aria-label=Filter for column]').set('1414234')
  • Related