Does the portlet-id-prefix change with every call?
On the other hand some of the functions also work with the "ID" as opposed to "ClientID". "ID" is what you code in the view-definition, basically the last part of the "ClientID". The "ClientID" is the concatenation of single IDs that make up the unique ID...
JSFUnit doesn't support JSF portlets yet. Part of the reason is the problem with client ID's that you have identified. There are a few other things that also must be taken into account. While all this is doable, I don't see portlet support happening until the end of the year unless someone in the community would like to take it on and help us out.