1.Open Pokemon Online. In the start screen (with Team, go online, credits, and exit) select "file" then "open replay." You can also just use ctrl+R as a shortcut.
2.Pick a replay file you want to use. To actually get files in there, you need to check the "record battle logs" box whenever you're in a battle. It'll stay checked until you uncheck it again, so it'll save every battle after you check it.
3.Go to this site and paste the log you want into the file, and it'll play a video clip of your battle. Note that it rarely puts in the correct trainer sprites though.
4.Watch the battle, or if you want, use a screen capture device like FRAPS or Bandicam to record it.