If the solution Agnius provided works, it works, but otherwise there are work-arounds this, and its a major pain indeed when you come across this type of website.
First of, you'll need to untick "Wait for page to load" this will prevent the webpage action from hanging and waiting indefinitely, then you'll need to provide a subsequent action that
a) waits for the popup
and then,
b) closes it
afterwards,
c) Waits for the content of the webpage to load, which can be any button / label / specific text, etc. (We do this because we don't know if the page has loaded yet or not during the popup)
and then finally
d) continues with the automation.