jeudi 4 janvier 2018

selenium issue: with dropdown using thymeleaf

I am facing an issue selecting a value inside a dropdown during a selenium test. I am getting my values from a properties file using thymeleaf in the following way.

<option th:each="medication : ${medications}"
        th:id="${medication.key}"
        th:value="${medication.value.fplPercent}"
        th:text="${medication.value.name}">
</option>

When I try to select a value in the dropdown, selenium is not able to do that. Instead of getting the dropdown values from properties file using thymeleaf, if I give all my options in the html file(like below), selenium is able to select a value from the dropdown with out any problem.

<option id="A" value="300">Ibuprofuen</option>
<option id="B" value="300">Tylenol</option>
<option id="C" value="300">Beatblocker</option>

I know how I get the values populated in the dropdown is causing me problems. Please advise me on how to overcome this issue. Thanks in advance

Aucun commentaire:

Enregistrer un commentaire