No, never try this, and always use protection for your generator against rain. It deserves a shade, keeping it out on a sunny day is not even a good option. There is a chance of water getting into your generator's fuel tank, and certainly. your generator is going to stop working. Later you will have to put a lot of effort to clean that, but you would be lucky if your generator stops working before electrocution. In case of electrocution, your generator's alternator might get completely damaged by the rainwater.