Reputation: 19
I need a help regarding robotium scripts.
I have the source code for the button
Button btnCreateTask = (Button) findViewById(R.id.btnCreateTask);
I want to click on button using robotium
I used the following code for it
Button CTButton = solo.getView(R.id.btnCreateTask);
solo.clickOnView(CTButton);
But I am getting an error like "btnCreateTask cannot be resolved or is not a field" Can anyone please help me why this error is coming. Is this the correct way I am using? Thanks
Upvotes: 0
Views: 881
Reputation: 706
Correct code is:
Button CTButton = solo.getView("btnCreateTask");
solo.clickOnView(CTButton);
Upvotes: 2