Trieste, Italy to Rijeka, Croatia by Bus

We would like to take a bus from Trieste to Rijeka then rent a car in Croatia, does anyone have info on the procedures and schedule for such a bus trip. are ultimate goal is to drive down to Dubrovnik. Thanks for your help.