How to handle alerts,pop-ups and non web page using this tool?

Need to know, which command is use for that.

am not sure what you mean but I think using the desktop automation helps with alerts and non webpage UIs

Correct, dialog buttons are best clicked in desktop automation mode. Here is a good example: Stupid issue about pop up windows when download files - #2 by Plankton