I need help to exit a test without getting error. I have this code:
tabla = self.driver.find_element_by_css_selector(".tablaSolicitudes")
for estado in tabla.find_elements_by_tag_name("td"):
e = estado.text
if e.find("Multiadhesion") != -1:
print("La solicitud " + solicitudes[i] + " se encuentra con MultiAdhesion. Finaliza el Test.")
sys.exit()
If that condition is true, the test should end. The point is that, having it like that, i get this error:
sys.exit()
SystemExit
----------------------
Ran 1 test in 139.733s
FAILED (errors=1)
But the test is OK, so, how can I make a proper "test exit" so that i don´t get this error?.
Thank you very much!