Back to project page verival-uiautomator.
The source code is released under:
GNU General Public License
If you think the Android project verival-uiautomator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package br.unb.vvs.uiautomator; //from w ww. j a v a2 s . c o m import static br.unb.vvs.uiautomator.StringGetter.getString; import java.util.Random; import com.android.uiautomator.core.UiObject; import com.android.uiautomator.core.UiObjectNotFoundException; import com.android.uiautomator.core.UiScrollable; import com.android.uiautomator.core.UiSelector; import com.android.uiautomator.testrunner.UiAutomatorTestCase; public class Test06_Send100TextMessage extends UiAutomatorTestCase { public void setUp() { String output = "\nTest " + this.getName().substring(4) + "() "; System.out.println(output); // Simulate a short press on the HOME button. getUiDevice().pressHome(); } public void testEnviarCemMensagensdeTexto() throws UiObjectNotFoundException { for(int i = 0; i < 100; i++){ UiScrollable appViews = new UiScrollable(new UiSelector().scrollable(true)); appViews.setAsHorizontalList().scrollBackward(); UiObject mensagensField = appViews.getChildByText(new UiSelector().className(android.widget.TextView.class.getName()), getString("messaging")); mensagensField.clickAndWaitForNewWindow(); String name = "83438877"; UiObject nameOrder = new UiObject (new UiSelector().className(android.widget.MultiAutoCompleteTextView.class.getName()).text(getString("to"))); nameOrder.clearTextField(); nameOrder.setText(name); String messengetext = "Verival test"; UiSelector messenge = new UiSelector().className(android.widget.EditText.class.getName()).text(getString("typeMessage")); UiObject messengeOrder = new UiObject (messenge); messengeOrder.clearTextField(); messengeOrder.setText(messengetext); UiSelector sendSelector = new UiSelector().className(android.widget.ImageButton.class.getName()).description(getString("send")); UiObject sendOrder = new UiObject (sendSelector); sendOrder.clickAndWaitForNewWindow(); getUiDevice().pressHome(); } } }