4 つのラジオ ボタンがあります。
<div class="x1-radio">
<input id = " " type="radio" name=" " value="12345">
<span class=" ">Radio 1 - Good Luck</span>
<div class="x1-radio">
<input id = " " type="radio" name=" " value="12345">
<span class=" ">Radio 2 - Good Luck</span>
<div class="x1-radio">
<input id = " " type="radio" name=" " value="12346">
<span class=" ">Radio 3 - Good Luck</span>
<div class="x1-radio">
<input id = " " type="radio" name=" " value="12347">
<span class=" ">Radio 4 - Good Luck</span>
これらはラジオ ボタンなので、一度に 1 つ選択できます。xpathを使用してラジオボタンを選択する方法を知っています:
nPath = '//*[@class="x1-radio"]//span[text() = "Radio 1 - Good Luck"]'
browser.element(:xpath, nPath).fire_event "onclick"
この時点でボタンが選択されています。私が知りたいのは、「input」タグの属性を1つずつ画面に表示する方法です。
私はここでいくつかの情報を見つけました: How can I get value of element custom attribute with Watir but could not do it.