admin管理员组文章数量:1391995
I am referencing a page that has a select element that looks like this:
<select id="make" name="Make">
<option value="default">– please select –</option>
<option value="Audi">Audi</option>
<option value="BMW">BMW</option>
<option value="Ford">Ford</option>
<option value="Honda">Honda</option>
<option value="Mazda">Mazda</option>
<option value="Mercedes Benz">Mercedes Benz</option>
<option value="Nissan">Nissan</option>
<option value="Opel">Opel</option>
<option value="Porsche">Porsche</option>
<option value="Renault">Renault</option>
<option value="Skoda">Skoda</option>
<option value="Suzuki">Suzuki</option>
<option value="Toyota">Toyota</option>
<option value="Volkswagen">Volkswagen</option>
<option value="Volvo">Volvo</option>
</select>
Inside my test case I am using this statement:
grab value by description "make" using AI to get all the option elements and concatenate their values and save them to "optionslist"
The result I get from TestRigor is this:
AI grabbed value '– please select –' because 'The "Make" field in the screenshot is a dropdown menu with the default value set to "– please select –," as indicated by the red border and the text displayed in the dropdown. Since no specific value has been selected, the field remains in its default state.' Stored value 'optionslist' was set to '– please select –'
What I expected was the last sentence above to say
Stored value 'optionslist' was set to
'– please select –AudiBMWFordHondaMazdaBenzNissanOpelPorscheRenaultSkodaSuzukiToyotaVolkswagenVolvo'
What should I do to get the expected result?
I am referencing a page that has a select element that looks like this:
<select id="make" name="Make">
<option value="default">– please select –</option>
<option value="Audi">Audi</option>
<option value="BMW">BMW</option>
<option value="Ford">Ford</option>
<option value="Honda">Honda</option>
<option value="Mazda">Mazda</option>
<option value="Mercedes Benz">Mercedes Benz</option>
<option value="Nissan">Nissan</option>
<option value="Opel">Opel</option>
<option value="Porsche">Porsche</option>
<option value="Renault">Renault</option>
<option value="Skoda">Skoda</option>
<option value="Suzuki">Suzuki</option>
<option value="Toyota">Toyota</option>
<option value="Volkswagen">Volkswagen</option>
<option value="Volvo">Volvo</option>
</select>
Inside my test case I am using this statement:
grab value by description "make" using AI to get all the option elements and concatenate their values and save them to "optionslist"
The result I get from TestRigor is this:
AI grabbed value '– please select –' because 'The "Make" field in the screenshot is a dropdown menu with the default value set to "– please select –," as indicated by the red border and the text displayed in the dropdown. Since no specific value has been selected, the field remains in its default state.' Stored value 'optionslist' was set to '– please select –'
What I expected was the last sentence above to say
Stored value 'optionslist' was set to
'– please select –AudiBMWFordHondaMazdaBenzNissanOpelPorscheRenaultSkodaSuzukiToyotaVolkswagenVolvo'
What should I do to get the expected result?
Share Improve this question asked Mar 16 at 14:06 WayneRoseberryWayneRoseberry 10114 bronze badges1 Answer
Reset to default 0Yes, you can use JavaScript to achieve this. The AI command which you were using context is wrong as well.
本文标签: How to get the value of all the option elements under a select element using TestRigorStack Overflow
版权声明:本文标题:How to get the value of all the option elements under a select element using TestRigor - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744598010a2614893.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论