Get select value of dropdown for capybara testing

前端 未结 6 2027
说谎
说谎 2020-12-24 10:33

I have to write tests for a web site. I am trying to get the selected value of a dropdown box. So far i can get the contents of the dropdown by doing

find_f         


        
6条回答
  •  执念已碎
    2020-12-24 11:04

    Very simple way to get value of selected option is:

    find("#restrictions__rating_movies").value
    

    This will return selected select option value.

提交回复
热议问题