Я новичок в selenium webdriver. Я пишу сценарий с помощью Java, но я застрял в написании сценария, я хочу, чтобы выбрать кнопку радио, но я получаюКак выбрать переключатель в селене webdriver?
Исключение в потоке «основной» org.openqa.selenium.ElementNotVisibleException: Элемент не отображается (ВНИМАНИЕ: сервер не предоставил информацию о стеке ).
Это я написал:
WebElement radioButton = driver.findElement(By.id("Radio_0_2461A"));
radioButton.sendKeys(Keys.SPACE);
Ниже HTML код:
HTML code for Find button.
<button class="button right secondary" id="selectProducts0" onclick="getProducts('0'); return false;">
Find Products
</button>
После нажатия кнопки продукт будет загружен, и я должен выбрать продукт из списка.
<div class="clearboth" id="productList0" style="overflow: hidden; display: block;">
<div class="productTableContainer" data-index="0">
<table class="responsive" cellspacing="0" cellpadding="0" summary="List of products">
<tbody>
<tr data-row-data='{"earlyRepaymentCharges":[],"incentives":[]}'>
<th class="radio">
<input id="0_2689A_StartDate" type="hidden" value="28/06/2016 00:00:01">
<input name="Products[0].ProductCode" title="Lifetime Tracker with £999 Fee" id="Radio_0_2689A" type="radio" value="2689A"> <label for="Radio_0_2689A">
Lifetime Tracker with £999 Fee </label>
<tr data-row-data='{"earlyRepaymentCharges":[{"step":"1","durationInMonths":"","endDate":"30/11/2016","percentage":"1%"}],"incentives":[]}'>
<th class="radio">
<input id="0_5555A_StartDate" type="hidden" value="01/11/2015 00:01:00">
<input name="Products[0].ProductCode" title="1 Year Fixed Rate Until 30/11/2016 with £999 Fee" id="Radio_0_5555A" type="radio" value="5555A">
<label for="Radio_0_5555A"> 1 Year Fixed Rate Until 30/11/2016 with £999 Fee
</label>
<tr data-row-data='{"earlyRepaymentCharges":[{"step":"1","durationInMonths":"","endDate":"28/02/2017","percentage":"2%"},{"step":"2","durationInMonths":"","endDate":"28/02/2018","percentage":"1%"}],"incentives":[]}'>
<th class="radio">
<input id="0_2461A_StartDate" type="hidden" value="18/12/2015 00:01:00">
<input name="Products[0].ProductCode" title="2 Year Fixed Rate Until 28/02/2018 with £999 Fee" id="Radio_0_2461A" type="radio" value="2461A">
<label for="Radio_0_2461A">2 Year Fixed Rate Until 28/02/2018 with £999 Fee
</label>
Пожалуйста, разместите свой код в самом вопросе, а не свяжите нас с ним. – ragingasiancoder