I'm working with Selenium Webdriver using ruby.
I have a dropdown and after each value/text selected inside it, I want to extract that value/text visible on webpage interface without html tags, because for that value selected, in div > option tag I do not have a specific attribute for it, to figure out which is the value, can I do that in selenium webdriver using ruby?
Edit : HTML code :
<select name="OwningAndUsingCarPanel.UseOfVehicle" id="OwningAndUsingCarPanel_UseOfVehicle" autocomplete="off">
<option value="0" selected="selected">Please select</option>
<option value="227">Social only</option>
<option value="228">Social including commuting to a single place of work</option>
<option value="229">Business use by you</option>
</select>
UPDATE - more details:
I've tried this method and it's working if you select previous some value, but in my case I have some bug in my dropdown values, something like this: have 5 dropdowns one after another, and each of them is depending on the previous dropdown, so if i begin to fill the form like this:
1). select value at first dropdown (take the text)
2). select at the second dropdown some value (take the text)
3). select at the third dropdown some value (take the text)
4). select at the fourth dropdown some value (take the text)
5). select at the fifth dropdown some value (take the text) (this dropdown is generated by the previous fourth dropdowns values) - now the second value of dropdown is changed on the interface webpage. (so here I cant put element.text for the second dropdwon because it extract the value I have selected point 2).
I want to check if after each selecting value the previous value remain the same on the webpage inteface, in my case I have some bug at this.