I have been looking at the scripting command reference and I am not seeing a way to deal with popups. Does anyone have some script examples on how to deal with popups?

popups are not supported in WebPagetest and any attempt to open one should get closed automatically (built-in blockers as well as custom code). Mostly because the code has no way of managing data from multiple simultaneous browsers right now.