Online Training: Web test automation with CodeceptJS. Sign up now!

Retry on "502 Bad Gateway" Server Response

Hi all,

whats the best way to retry a scenario when the server responds with “502 Bad Gateway”?

Thanks

I would personally avoid retrying a whole scenario for a 502 bad gateway. Usually any 50x error should be raised to your dev/infra/devops team to fix. As a workaround, you can look for 502 in the response code/status code, headers, page title etc and do a page refresh up to 5 retries for page refresh. If after 5 page refreshes the error is still there, I would raise that as a problem to be fixed.