try:
eltext = driver.find_element_by_xpath("//*[@title='1Sign In / Sign Up']").text
except NoSuchElementException as e:
# logger.write("Test Failed",level='FAIL',html=True)
BuiltIn().log(e.msg, level='FAIL', html=True, console=True, repr=True)
In this case ex1, test case is passing since there it is reporting error in logs.html but test case and keyword is getting passed.
ex2- Lib.pySee screenshot-1 for report logs.html.def elementVerfication();try:
eltext = driver.find_element_by_xpath("//*[@title='1Sign In / Sign Up']").text
except NoSuchElementException as e:
# logger.write("Test Failed",level='FAIL',html=True)
BuiltIn().fail(e.msg)TestExmaple.robotTest Case 2 - Scroll Up, find element & click on it
elementVerification
Run Keyword And Continue On Failure should be equal as strings ${text} SIGN IN / SIGN UP
clickSignIn
expliciteWaitIn ex2, it is simply executing the fail and terminating the program, my other statement/keywords in the robot file is not executable in this case.WHAT DO I WANT:-As given in ex1, I want it to report in logs.html but also I need to fail it.Either test case should fail or keyword should fail.Could you please help me how I do fail test case in except block so that my remaining code will also work and test would fail too and it is logged in report as well.I have tried to useQuick Start Guide but related to my there is no explanation.In my case, it is NoSuchElementFound Exception which is related to selenium, and once it will occur then program will terminate.If handled then it will go ahead and will not show any fail in report as I mentioned.I have seen the below section in documentationclass MyError(RuntimeError): ROBOT_SUPPRESS_NAME = TrueBut still it is not helpfulI hope it is understandable.
Thanks in advance.
Ugh
Have you read this: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#continuing-test-execution-despite-of-failures
-Tatu
Send from my mobile
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.