Can enemy Pokémon run out of PP for their moves and use Struggle?

Say that I am battling a Pokémon, either a wild one or one owned by a trainer. If it uses the same move enough times (perhaps a Magikarp who keeps using Splash), is it possible for it to run out of PP and use Struggle?

I'm especially interested in third, fifth, and sixth generation because that's the ones I own, but information for all generations would be appreciated.


Solution 1:

Yes, also your opponents do have PP. This means they will use Struggle if they run out their PP. Several people on Gamefaqs have seen a Legendary Pokemon hitting himself with Struggle after a long battle.

This is true for each generation, except for Gen I:

In Generation I, all AI opponents had unlimited PP.

Here's another related answer, for reference.