How can I check if the site is up without actually opening the browser using Robot ?
This is what I've got so far:
*** Keywords ***
Load staging server if available
Create Session localhost ${STAGING_SERVER}
${response}= get request localhost /
Run Keyword If ${response.status_code} == 200
... Open Browser ${STAGING_SERVER} ${BROWSER}
... ELSE
... Open Browser ${DEVELOPMENT_SERVER} ${BROWSER}
I'm using Robot's RequestsLibrary. The problem with my code is that it won't even manage to get status code of the response if the site is down because it will fail to establish http connection.