I have code that is choosing is choosing an option from a drop down list you see below. (code is under this). My question is why is this working on Chrome Browser but on Mozilla it is not doing anything except warning that it is slowing down program?
<select class="combobox i_realm" name="realm" id="i_realm" onchange="SetCookie('realm', this.selectedIndex);">
<option value="0">-- Wybierz krainę </option>
<option value="1"> » R1 Necropolia </option>
<option value="2"> » R2 Moria </option>
<option value="3"> » R3 Necropolia II </option>
<option value="4"> » R4 Necropolia III </option>
<option value="5"> » R5 Moria II </option>
<option value="6"> » R6 Necropolia IV </option>
<option value="7"> » R7 Necropolia V </option>
<option value="8"> » R8 Necro Hardcore </option>
<option value="9"> » R9 Moria III </option>
<option value="10"> » R10 Necropolia VI </option>
<option value="11"> » R11 Necropolia VII </option>
<option value="12"> » R12 Necropolia VIII </option>
<option value="13"> » R13 Moria IV </option>
<option value="14"> » R14 Necropolia IX </option>
<option value="15"> » R15 Moria V </option>
<option value="16"> » R16 Necropolia X </option>
<option value="17"> » R17 Moria VI </option>
<option value="18"> » R18 Necropolia XI </option>
</select>
WebElement element
element=driver.findElement(By.id("i_realm"));
Select select=new Select(element);
select.selectByValue("17");
In firefox, I also suffered this issue and I had tried to click on dropdown then select value and it was working. Run below code.
Code:
WebElement element;
element=driver.findElement(By.id("i_realm"));
element.click();
Select select = new Select(element);
select.selectByValue("17");