If its a windows popup, selenium cant detect it. You may need to handle it using other windows automation tools like AutoIT, AutoHotKey,Winium, etc. All these tools offer simple commands to perform these tasks (which can easily be found online). And these scripts can be called from selenium/java code.