One way to fail the test based on condition is to use LogType.Error
. This will immediately fail the test and log a message of your choice to the execution log. See this video
for a quick demonstration of its usage. The other two options are explained in this article
Let me know if you need further assistance on this.