Place onions and tomatoes in a saucepan. Sprinkle with salt and stir gently. Add green beans, olive oil and sugar; stir. Cover and cook over medium low heat, stirring occasionally, for about 15 minutes until beans are softened. Once the liquid has been absorbed, stir fry a couple of minutes. Add 1/2 cup water, cover, and simmer 40 minutes until beans are tender. The beans will be moist, but not watery.