Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
If they truly were switching endlessly, you could just attack them and they would eventually faint. If you were also infinitely switching or doing some other action to not damage the opponent, Endless Battle Clause would kick in and stop the battle after 1000 turns. As it is, such an "Endless Swapping Clause" is entirely unnecessary.