Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Filling in text box with capybara

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<span class="ui-grid-header-cell-label ng-binding" ui-grid-one-bind-id-grid="col.uid + '-header-text'" id="14213131-uiGrid-0008-header-text">DOB</span>

<input type="text" class="ui-grid-filter-input ui-grid-filter-input-0 ng-touched" 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.

>Solution :

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')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading