android.app.Instrumentation.sendStringSync()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(264)

本文整理了Java中android.app.Instrumentation.sendStringSync()方法的一些代码示例,展示了Instrumentation.sendStringSync()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instrumentation.sendStringSync()方法的具体详情如下:
包路径:android.app.Instrumentation
类名称:Instrumentation
方法名:sendStringSync

Instrumentation.sendStringSync介绍

暂无

代码示例

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public void sendStringSync(String text) {
  base.sendStringSync(text);
}

代码示例来源:origin: RobotiumTech/robotium

/**
 * Types text in the specified WebElement.
 *
 * @param webElement the WebElement to type text in
 * @param text the text to enter in the {@link WebElement} field
 */
public void typeTextInWebElement(WebElement webElement, String text){
  if(config.commandLogging){
    Log.d(config.commandLoggingTag, "typeTextInWebElement("+webElement+", \""+text+"\")");
  }
  
  clickOnWebElement(webElement);
  dialogUtils.hideSoftKeyboard(null, true, true);
  instrumentation.sendStringSync(text);
}

代码示例来源:origin: RobotiumTech/robotium

/**
 * Types text in a WebElement matching the specified By object.
 *
 * @param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
 * @param text the text to enter in the {@link WebElement} field
 * @param match if multiple objects match, this determines which one will be typed in
 */
public void typeTextInWebElement(By by, String text, int match){
  if(config.commandLogging){
    Log.d(config.commandLoggingTag, "typeTextInWebElement("+by+", \""+text+"\", "+match+")");
  }
  
  clicker.clickOnWebElement(by, match, true, false);
  dialogUtils.hideSoftKeyboard(null, true, true);
  instrumentation.sendStringSync(text);
}

代码示例来源:origin: RobotiumTech/robotium

inst.sendStringSync(text);
  successfull = true;
}catch(SecurityException e){

代码示例来源:origin: darkskygit/VirtualApp

@Override
public void sendStringSync(String text) {
  base.sendStringSync(text);
}

代码示例来源:origin: bzsome/VirtualApp-x326

@Override
public void sendStringSync(String text) {
  base.sendStringSync(text);
}

代码示例来源:origin: luili16/UIMocker

@Override
@CallSuper
public void sendStringSync(String text) {
  if (DEBUG) {
    Logger.d(TAG,"sendStringSync");
  }
  mInstrumentation.sendStringSync(text);
}

代码示例来源:origin: com.jayway.android.robotium/robotium-solo

/**
 * Types text in a WebElement matching the specified By object.
 *
 * @param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
 * @param text the text to enter in the {@link WebElement} field
 * @param match if multiple objects match, this determines which one will be typed in
 */
public void typeTextInWebElement(By by, String text, int match){
  if(config.commandLogging){
    Log.d(config.commandLoggingTag, "typeTextInWebElement("+by+", \""+text+"\", "+match+")");
  }
  
  clicker.clickOnWebElement(by, match, true, false);
  dialogUtils.hideSoftKeyboard(null, true, true);
  instrumentation.sendStringSync(text);
}

代码示例来源:origin: com.jayway.android.robotium/robotium-solo

/**
 * Types text in the specified WebElement.
 *
 * @param webElement the WebElement to type text in
 * @param text the text to enter in the {@link WebElement} field
 */
public void typeTextInWebElement(WebElement webElement, String text){
  if(config.commandLogging){
    Log.d(config.commandLoggingTag, "typeTextInWebElement("+webElement+", \""+text+"\")");
  }
  
  clickOnWebElement(webElement);
  dialogUtils.hideSoftKeyboard(null, true, true);
  instrumentation.sendStringSync(text);
}

代码示例来源:origin: com.jayway.android.robotium/robotium-core

clicker.clickOn(EditText.class, index);
try{
  inst.sendStringSync(text);
  inst.sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER);
}catch(SecurityException e){
  inst.sendStringSync(text);
}catch(SecurityException e){
  Assert.assertTrue("Text can not be entered!", false);
  inst.sendStringSync(text);
}catch(SecurityException e){
  Assert.assertTrue("Text can not be entered!", false);

代码示例来源:origin: blurpy/kouchat-android

/**
 * Writes the text to the field with current focus.
 *
 * <p>This can be used when it's important not to change the state of the view with focus.
 * Using the regular method to enter text will put the view in a strange state where the cursor
 * disappears, and pressing 'enter' changes focus to the next view instead of adding a new line.</p>
 *
 * @param instrumentation The test instrumentation.
 * @param text The text to write.
 */
public static void writeText(final Instrumentation instrumentation, final String text) {
  // Send one character at the time, with some sleep, to hack around some weird issue where sometimes
  // the characters end up in the wrong order
  for (int i = 0; i < text.length(); i++) {
    final String character = String.valueOf(text.charAt(i));
    instrumentation.sendStringSync(character);
    Tools.sleep(15);
  }
}

代码示例来源:origin: com.jayway.android.robotium/robotium-solo

inst.sendStringSync(text);
  successfull = true;
}catch(SecurityException e){

相关文章

Instrumentation类方法