views:

55

answers:

2

Hi All,

I'm trying to test a date picker scenario on android. I have the date picker which comes up when I click a text view(with id say v) which has a label on it along with a hint "Enter Date".

The problem is that I'm trying to simulate this clicking of the text view and then selecting of the date from the date picker dialog. I cannot find an method call/option in Solo to get hold of the text view (ex:with id say x). I've been trying to figure it out for the past three days.

Can anyone suggest me a way to go about it?.

Thanks

Prasanna

+1  A: 

Hi Prasana,

I am not sure that I completely understand your question. You can use clickOnText("Enter Date") or clickOnView(id of the view) and then you continue with clicking or doing an assert with searchText() searching a date or clicking on a specific view. An example of how clickOnView() can be used:

solo.clickOnView(solo.getCurrentActivity().findViewById(com.example.android.notepad.R.id.note));

/Renas

Renas
+1  A: 

Prasana

Are you talking about EditText's instead of TextView's? Then try either one of these:

    solo.clearEditText(0);
    solo.enterText(0, "bla");
pjv