Hello, I have an issue with an assertion stopping my script and not continuing execution to close the browser. I am checking that a user sees the homepage after entering correct credentials. In the scenario that the wrong credentials have been entered this stops after the assert, I get the right error, but the browser is never closed.
I know in other functions that you can add the FailureHandler as a parameter and tell it to continue. But assert isn’t called in the same way. I was considering a try/catch/finally statement but feel that is bad practice. Any advice? Thanks in advance!
**CODE********************************************
//After user enters correct credentials, user should see the homepage
assert WebUI.getWindowTitle() == GlobalVariable.homePage_PageTitle
//If bad credentials then execution does not continue to close the browser window
WebUI.closeBrowser()
******************************************************