< select class="select_xpath_class" name="myMethods[select_method_id_23749837]" id="select_method_id_23749837"> Please select... Select1 Select2 Select3 </select>
Capybara method of select won't work:
page.select("Select1", :from => "select_method_id")This is because it will only find the exact match of the id.
To solve this we can use the find method directly with xpath:
find(:xpath, "//*[contains(@id, 'select_method_id')]").select("Select1")