<h5 _ngcontent-c2="" class="card-title">Payment Mode </h5>
<!---->
<div _ngcontent-c2="">
<div _ngcontent-c2="" class="form-group">
<input _ngcontent-c2="" name="paymentmode" type="radio" style="">
<b _ngcontent-c2="">Credit Card</b>
</div>
</div>
<div _ngcontent-c2="">
<div _ngcontent-c2="" class="form-group">
<input _ngcontent-c2="" name="paymentmode" type="radio">
<b _ngcontent-c2="">Debit Card</b>
</div>
</div>
<div _ngcontent-c2="">
<div _ngcontent-c2="" class="form-group">
<input _ngcontent-c2="" name="paymentmode" type="radio">
<b _ngcontent-c2="">Net Banking</b>
</div>
</div>
<div _ngcontent-c2="">
<div _ngcontent-c2="" class="form-group">
<input _ngcontent-c2="" name="paymentmode" type="radio">
<b _ngcontent-c2="">UPI</b>
</div>
</div>
上記の HTML では、ラジオ ボタンの値に基づいてラジオ ボタンを選択しようとしています。分度器 NuGet パッケージをセレン Web ドライバーと共に使用しています。
IList<NgWebElement> oCheckBox = ngDriver.FindElements(By.XPath("//input[@name='paymentmode']"));
int Size = oCheckBox.Count;
for (int i = 0; i < Size; i++)
{
String Value = oCheckBox.ElementAt(i).GetAttribute("value");
if (Value.Equals("Net Banking"))
{
oCheckBox.ElementAt(i).Click();
break;
}
}
の定義は含まれていIList<NgWebElement>
ませんElementAt
。
支払いモードに基づいてラジオボタンを選択する方法はありますか?