Hi I have already write code for automation testing it is working fine, but i need to do this automation as slow motion if it is possible please give me any suggestion.. i have mention my code bellow. this bellow code will ruuning successfully but i need to do with slow motion.
@RunWith(AndroidJUnit4.class)
public class SurveyAutomationTest {
private String[] Name = new String[]{"prashant", "kiccha"};
private String[] Phone = new String[] {"9742174495", "1234567890"};
private String[] Distrcit = new String[]{"Koppal", "Bidar"};
private String[] Taluk = new String[]{"koppal", "aurad"};
private String[] Village = new String[]{"agalakera", "aknapur"};
private String[] Etl1 = new String[]{"1-10","1-10"};
private String[] Etl2 = new String[]{"20-50","20-50"};
private String[] Etl3 = new String[]{"11-20","11-20"};
private String[] Etl4 = new String[]{"20-50","20-50"};
//private String[] District = new String[] {""};
@Rule
public ActivityTestRule<HomeActivity> mActivityRule = new ActivityTestRule<HomeActivity>(HomeActivity.class);
@Test
public void homeActivityTest() {
for (int i = 0; i < 20; i++) {
Random name = new Random();
int Rname = name.nextInt(2);
onView(withId(R.id.setting)).perform(click());
onView(withId(R.id.connect_printer)).perform(click());
onView(AllOf.allOf(withText("BTP110-0210\n98:D3:31:B2:82:C5"),isDisplayed())).perform(click());
onView(withId(R.id.save)).perform(click());
onView(AllOf.allOf(withId(android.R.id.button1), withText("OK"),isDisplayed())).perform(click());
onView(withId(R.id.AddfarmerButton)).perform(click());
onView(withId(R.id.farmernameedit)).perform(typeText(Name[Rname]), closeSoftKeyboard());
onView(withId(R.id.farmerphnoedit)).perform(typeText(Phone[Rname]), closeSoftKeyboard());
onView(withId(R.id.districtlist)).perform(click());
ViewInteraction checkedTextView = onView(allOf(withId(android.R.id.text1), withText(Distrcit[Rname]), isDisplayed()));
checkedTextView.perform(click());
ViewInteraction spinner2 = onView(allOf(withId(R.id.taluklist), withParent(allOf(withId(R.id.Taluklayout), withParent(withId(R.id.linearLayout09))))));
spinner2.perform(scrollTo(), click());
ViewInteraction checkedTextView2 = onView(allOf(withId(android.R.id.text1), withText(Taluk[Rname]), isDisplayed()));
checkedTextView2.perform(click());
ViewInteraction spinner3 = onView(allOf(withId(R.id.villagelist), withParent(allOf(withId(R.id.Villagelayout), withParent(withId(R.id.linearLayout09))))));
spinner3.perform(scrollTo(), click());
ViewInteraction checkedTextView3 = onView(allOf(withId(android.R.id.text1), withText(Village[Rname]), isDisplayed()));
checkedTextView3.perform(click());
ViewInteraction imageButton3 = onView(allOf(withId(R.id.photo), withParent(allOf(withId(R.id.RelativeLayout16), withParent(withId(R.id.linearLayout3)))), isDisplayed()));
imageButton3.perform(click());
onView(withId(R.id.confirm)).perform(click());
Aucun commentaire:
Enregistrer un commentaire