I have this form and I need to click on the input type button with de value = CASTRO SALVADOR.
<code><form name="seleccionaEmpresaForm" action="setearContribuyente.do">
<table width="50%" align="center">
<tbody><tr><td height="5"></td></tr>
<tr><td align="center"><b>Seleccione la Empresa a representar:</b></td></tr>
<tr><td height="5"></td></tr>
<tr>
<td align="center">
<input type="hidden" name="idContribuyente" id="idcontribuyente">
<input type="button" class="btn_empresa ui-button ui-widget ui-state-default ui-corner-all" style="width:100%" value="CASTRO SALVADOR" onclick="document.getElementById('idcontribuyente').value='0';document.seleccionaEmpresaForm.submit();" role="button">
</td>
</tr>
<tr><td height="5"></td></tr>
</tbody></table>
</form>
</code>
<code><form name="seleccionaEmpresaForm" action="setearContribuyente.do">
<table width="50%" align="center">
<tbody><tr><td height="5"></td></tr>
<tr><td align="center"><b>Seleccione la Empresa a representar:</b></td></tr>
<tr><td height="5"></td></tr>
<tr>
<td align="center">
<input type="hidden" name="idContribuyente" id="idcontribuyente">
<input type="button" class="btn_empresa ui-button ui-widget ui-state-default ui-corner-all" style="width:100%" value="CASTRO SALVADOR" onclick="document.getElementById('idcontribuyente').value='0';document.seleccionaEmpresaForm.submit();" role="button">
</td>
</tr>
<tr><td height="5"></td></tr>
</tbody></table>
</form>
</code>
<form name="seleccionaEmpresaForm" action="setearContribuyente.do">
<table width="50%" align="center">
<tbody><tr><td height="5"></td></tr>
<tr><td align="center"><b>Seleccione la Empresa a representar:</b></td></tr>
<tr><td height="5"></td></tr>
<tr>
<td align="center">
<input type="hidden" name="idContribuyente" id="idcontribuyente">
<input type="button" class="btn_empresa ui-button ui-widget ui-state-default ui-corner-all" style="width:100%" value="CASTRO SALVADOR" onclick="document.getElementById('idcontribuyente').value='0';document.seleccionaEmpresaForm.submit();" role="button">
</td>
</tr>
<tr><td height="5"></td></tr>
</tbody></table>
</form>
I’m trying to use this script of selenium:
<code>WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "//input[contains(@class, 'btn_empresa') and @value='CASTRO SALVADOR']"))).click()
</code>
<code>WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "//input[contains(@class, 'btn_empresa') and @value='CASTRO SALVADOR']"))).click()
</code>
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "//input[contains(@class, 'btn_empresa') and @value='CASTRO SALVADOR']"))).click()
I also try:
<code>boton = driver.find_element(By.CSS_SELECTOR, "input.btn_empresa[value='CASTRO SALVADOR']")
boton.click()
</code>
<code>boton = driver.find_element(By.CSS_SELECTOR, "input.btn_empresa[value='CASTRO SALVADOR']")
boton.click()
</code>
boton = driver.find_element(By.CSS_SELECTOR, "input.btn_empresa[value='CASTRO SALVADOR']")
boton.click()
Can anyone help me?
Tks