updated way of detecting when selenium test went wrong