You might want to give the following code a try:
First you could match the SeekBar
with its class name:
onView(withClassName(Matchers.equalTo(SeekBar.class.getName()))).perform(setProgress(progress));
where setProgress(final int progress) is a ViewAction you defined as:
public static ViewAction setProgress(final int progress) {
return new ViewAction() {
@Override
public void perform(UiController uiController, View view) {
SeekBar seekBar = (SeekBar) view;
seekBar.setProgress(progress);
}
@Override
public String getDescription() {
return "Set a progress on a SeekBar";
}
@Override
public Matcher<View> getConstraints() {
return ViewMatchers.isAssignableFrom(SeekBar.class);
}
};
}