So medieval knights ever go through the training our soldiers do? Such as obstacle courses that could be similar to terrain they would be faced with. Or did they only do things like sword training
Obstacle courses? Not so much--not that we know of, at least.
Knights did train, but it wasn't anything like an organized bootcamp like today's soldiers go through. In part, because knights didn't belong to any sort of standing army like states make use of today.
Knights began their training at a pretty early age. Their training was more individual and very practical. We do have a handful of treatises from across Europe and at different times that give "advice" to young nobles on how they should spend their time and direct their energies. These do give us some insight in to what sort of training a knight could expect to take part in.
For example, the Konungs skuggsjá (a.k.a. "Speculum regale", a.k.a "King's Mirror") is a text from the middle of the 13th century from Norway. It is written as a series of instruction from an older man to his son on politics and morals and how he should act (for more context, the text was written for the benefit of Prince Magnus Lagabøte, who later became King Magnus VI of Norway). In this, the young man is instructed to take every opportunity to practice horseback riding, and specifically to practice mounting, sitting, and riding properly on his horse in full armor with thighs pressed close and holding both the shield and reins by the left hand. He is also instructed to practice fencing (with sword and shield) in full armor with his compatriots. He is instructed to practice twice a day if he is serious, and to never let a day pass without practicing at least once--holidays excluded. And for outdoor sports, practicing throwing spears, archery, and throwing stones with a sling for both distance and accuracy was to be considered good and proper entertainment.
At the beginning of the 15th century, French knight Jean Le Maingre, a champion jouster and warrior of some renown (he would go on to command the French vanguard at Agincourt, where he was captured by the English) in his biography set forth his fitness regimen. Now, admittedly, Le Maingre was a rather exceptional individual, and he was writing about ideals and doing a bit of self-aggrandizement, but he laid out that his workout consisted of: wall climbs, vaulting on to his horse, climbing up the underside of a ladder using only his arms, picking up and throwing heavy stones, doing somersaults, running, and dancing -- and to do all these things in full armor. (for fun, here is a translation of part of the text with visual demonstrations.)