Capturing Webpage variable on synthetic monitor step

Api.fail is documented here and the events API is documented here