In this article we are going to see how to validate different items at an Android device while performing Unit Testing using robotium framework. Basically we will check whether the item present or not.
We need to initiate the Solo object. After initiation, we will uses solo to get those.
Check Box :
-To validate(true/false) a with specific Index whether it is checked or not.
solo.isCheckBoxChecked(0);
-To validate(true/false) a with specific text of the item whether it is checked or not.
solo.isCheckBoxChecked("lebelText");
Radio Button :
-To validate(true/false) a with specific Index whether it is selected or not.
solo.isRadioButtonChecked(0);
-To validate(true/false) a with specific text of the item whether it is selected or not.
solo.isRadioButtonChecked("lebelText");
Spinner Menu / Sub Menu :
-To validate(true/false) if the specific text is selected in any Spinner in screen.So, it returns true if that text is present
solo.isSpinnerTextSelected("lebelText");
-To validate(true/false) if the specific text is selected in indexed (0 based) Spinner in screen. We are just specifying the spinner here.
solo.isSpinnerTextSelected(0, "lebelText");
Toggle Button :
-To validate(true/false) a with specific Index whether it is checked or not.
solo.isToggleButtonChecked(0);
-To validate(true/false) a with specific text of the item whether it is checked or not.
solo.isToggleButtonChecked("lebelText");
Text based compound button :
-To Check the specific Text is checked or not. It is used with checked text box or compound button.
solo.isTextChecked("lebelText");
Note : As all are validation functions , so each function returns Boolean value(true/false). So we can use them for conditional purpose.
...Thanks...:)
We need to initiate the Solo object. After initiation, we will uses solo to get those.
Check Box :
-To validate(true/false) a with specific Index whether it is checked or not.
solo.isCheckBoxChecked(0);
-To validate(true/false) a with specific text of the item whether it is checked or not.
solo.isCheckBoxChecked("lebelText");
Radio Button :
-To validate(true/false) a with specific Index whether it is selected or not.
solo.isRadioButtonChecked(0);
-To validate(true/false) a with specific text of the item whether it is selected or not.
solo.isRadioButtonChecked("lebelText");
Spinner Menu / Sub Menu :
-To validate(true/false) if the specific text is selected in any Spinner in screen.So, it returns true if that text is present
solo.isSpinnerTextSelected("lebelText");
-To validate(true/false) if the specific text is selected in indexed (0 based) Spinner in screen. We are just specifying the spinner here.
solo.isSpinnerTextSelected(0, "lebelText");
Toggle Button :
-To validate(true/false) a with specific Index whether it is checked or not.
solo.isToggleButtonChecked(0);
-To validate(true/false) a with specific text of the item whether it is checked or not.
solo.isToggleButtonChecked("lebelText");
Text based compound button :
-To Check the specific Text is checked or not. It is used with checked text box or compound button.
solo.isTextChecked("lebelText");
Note : As all are validation functions , so each function returns Boolean value(true/false). So we can use them for conditional purpose.
...Thanks...:)