IF this exists in browser do X, and how to manage different paths multiple ways the task can run

I have the following visible on a page. When this is visible in the front browser window I want my script to not cancel and continue...

<i class="icon-attention"></i>

I have an If/Else in my task how best to say if this class exists do X.

Second part to this question, say I have another condition so the task can run down different paths. So in case where class exists do this Path A route. If in scenario where (for example) the title of the browser contains this string go down Path B.

for your second question, use a Switch: