How to successfully running API Test using Robot Framework in CircleCI?

Hi, I’m Ryo. Currently, I have a Web Automation using Robot Framework that requires an API Test as a preconditioning step. This scenario will run in CircleCI. When running in my Locale (my Laptop), the API Test was successful. But, when it runs in CircleCI, it gets “IP Address not registered”. This response appears because the IP Address has not been whitelisted in my configuration. But, I don’t know the IP Address to be whitelisted if the script is running in CircleCI. Can you guys help me? Thank you.

Maybe IP ranges - CircleCI helps ?

So if you set circleci_ip_ranges: true to your yaml, you can get the list of ip addressed to whitelist on your end ?

Hi Ryo,

I gather you access the api and web app by a host name (FQDN?) rather than the IP address?

you could add a step at the beginning to your test like this:

${dnsdata}=    Evaluate    socket.gethostbyname_ex("")    modules=socket

For I get: ('', [], [''])

This will do 2 things,:

  • first on your local machine it will give you the ip address you probably want to whitelist
  • second on your CI runner machine it will give you the ip address you probably need to whitelist if it’s different from what you get locally

adding this itself wont stop your test from failing but hopefully will give you what you need for the whitelist :crossed_fingers:

I’m not familiar with CircleCI, but perhaps your CircleCI admins know a way to automatically add ip’s to the whitelist based on a host name withing the CI configuration, wouldn’t hurt to ask them.

Hope this helps,


@damies13 's answer highlights quite well about the question. OP gave a random error message “IP Address not registered”. There’s no indication of what tool generates this error.

  1. Is it coming from your API endpoint (my assumption)
  2. is it DNS issue where, in your tests your API endpoint is referred by the name and that name cannot be translated into actual IP address ?
  3. Is the ip address of your API endpoint on actual public ip address space ? If its not, maybe running the test from circleci is not even possible without using some sort of VPN …
1 Like