What is the length of the cable between arduino boards? Do you know that on UNO boards UART pins are also used for virtual serial port while connected on USB, so it will not work while on USB (as far as I remember, I'm not an arduino specialist)?
It would be useful if you could post code which you tried and it was not working. It is hard to say what you should try next, when we don't know what you have tried already. Keep in mind, that while there are tons of badly witten arduino code online, the fact that you have tried many and none worked probably means that the problem is either not the code or there is a need to configure the code in some way for your particular case.