Bring a large pan of salted water to the boil over a medium heat then add the beans and boil without lid until they are slightly soft but still slightly crunchy; about 7-10 minutes. Check often so that the beans don't get overcooked.
Mix the balsamic, olive oil, garlic, sugar, salt, parsley, onion and pepper together in a bowl.
Drain beans and toss with the vinaigrette while still warm. Marinate at room temperature for at least 1 hour. Serve cold or at room temperature.