Capybara - Selenium - Ruby - testing dynamic id -


i have following element (radio-button)which need select

input class="pull-left" data-class="then-radio-button" id="condition_fields_24934_condition_action_hide" name="condition_fields[24934][condition_action]" type="radio" value="hide" 

how select considering part of id name dynamic - particularly in example it's 24934 changes every time run test?

i use ruby writing tests.

thank in advance!

have consider using cssselector instead? in such case css best option , can use partial search that.

[id^='condition_fields_'][data-class='then-radio-button'] 

translation: id->starts condition_fields_ , having data-class then-radio-button

edit

for additional filtering adding value may helpful well.

[id^='condition_fields_'][data-class='then-radio-button'][value='hide'] 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -