0
I am working with software testing automation using Capybara with Siteprism and I am not able to click on a Radiobutton from the GLPI tool. This specific page was generated with the GLPI Formscreator plugin. I just need to select a specific radius. I’ll post the code snippet that doesn’t work.
class CadastroChamado < SitePrism::Page
include Capybara::DSL
element :escolhe_versao, :"#formcreator_field_2274_2"
def cadastro_chamado()
. . .
escolhe_versao.click
. . .
end
end
This is the HTML of the page where the component is:
<div class="form-group required line1" id="form-group-formcreator_field_2274">
<label for="formcreator_field_2274">Informe a versão <span class="red">*</span></label>
<div class="help-block"></div><div class="form_field">
<input type="hidden" class="form-control" name="formcreator_field_2274" value="">
<div class="formcreator_radios">
<input type="radio" class="form-control" name="formcreator_field_2274" id="formcreator_field_2274_1" value="Versão 11">
<label for="formcreator_field_2274_1">Versão 11</label>
<input type="radio" class="form-control" name="formcreator_field_2274" id="formcreator_field_2274_2" value="Versão 12">
<label for="formcreator_field_2274_2">Versão 12</label>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery("input[name='formcreator_field_2274']").on("change", function() {
jQuery("input[name='formcreator_field_2274']").each(function() {
if (this.checked == true) {
formcreatorChangeValueOf (2274, this.value);
}
});
});
});
</script>
</div>
</div>