I did it in this way. In compound view I gave unique ids to each element. Then in test code I could access them uniquely like this,
private View inflaterView;
LayoutInflater i=(LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflaterView=i.inflate(R.layout.screen_layout, null);
seekBar=(SeekBar) inflaterView.findViewById(R.id.vol_Row1).findViewById(R.id.seekbar);