当前位置: 首页>>代码示例>>Java>>正文


Java Response.getValue方法代码示例

本文整理汇总了Java中org.openqa.selenium.remote.Response.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Response.getValue方法的具体用法?Java Response.getValue怎么用?Java Response.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openqa.selenium.remote.Response的用法示例。


在下文中一共展示了Response.getValue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: send

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
@Nonnull
private Object send(@Nonnull String cmd, @Nonnull Map<String, Object> params) throws IOException {
	Map<String, Object> exe = ImmutableMap.of("cmd", cmd, "params", params);
	Command xc = new Command(m_wd.getSessionId(), "sendCommandWithResult", exe);
	Response response = m_wd.getCommandExecutor().execute(xc);

	Object value = response.getValue();
	if(response.getStatus() == null || response.getStatus().intValue() != 0) {
		//System.out.println("resp: " + response);
		throw new MyChromeDriverException("Command '" + cmd + "' failed: " + value);
	}
	if(null == value)
		throw new MyChromeDriverException("Null response value to command '" + cmd + "'");
	//System.out.println("resp: " + value);
	return value;
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:17,代码来源:ChromeExtender.java

示例2: execute

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
/**
 * This method executes a command supported by Appium JSONWP.
 *
 * @param commandName a JSONWP command
 * @param parameters is a map which contains parameter names as keys and parameter values
 * @return a command execution result
 */
public Object execute(String commandName, Map<String, ?> parameters) {
    Response response;

    if (parameters == null || parameters.isEmpty()) {
        response = driver.execute(commandName, ImmutableMap.<String, Object>of());
    } else {
        response = driver.execute(commandName, parameters);
    }

    return response.getValue();
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:19,代码来源:AppiumExecutionMethod.java

示例3: getContextHandles

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
@Override public Set<String> getContextHandles() {
    Response response = execute(DriverCommand.GET_CONTEXT_HANDLES);
    Object value = response.getValue();
    try {
        List<String> returnedValues = (List<String>) value;
        return new LinkedHashSet<>(returnedValues);
    } catch (ClassCastException ex) {
        throw new WebDriverException(
            "Returned value cannot be converted to List<String>: " + value, ex);
    }
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:12,代码来源:AppiumDriver.java

示例4: getAppStringMap

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
/**
 * @param language   strings language code.
 * @param stringFile strings filename.
 * @return a map with localized strings defined in the app.
 * @see HasAppStrings#getAppStringMap(String, String).
 */
@Override public Map<String, String> getAppStringMap(String language, String stringFile) {
    String[] parameters = new String[] {"language", "stringFile"};
    Object[] values = new Object[] {language, stringFile};
    Response response = execute(
        MobileCommand.GET_STRINGS, MobileCommand.prepareArguments(parameters, values));
    return (Map<String, String>) response.getValue();
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:14,代码来源:AppiumDriver.java

示例5: getBrightness

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public int getBrightness() {
  Response response = execute("selendroid-getBrightness");
  Number value = (Number) response.getValue();
  return value.intValue();
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:10,代码来源:SelendroidDriver.java

示例6: getConfiguration

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
@Override
public Map<String, Object> getConfiguration(DriverCommand command) {
  Response response =
      execute("selendroid-getCommandConfiguration", ImmutableMap.of("command", command.command));

  return (Map<String, Object>) response.getValue();
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:8,代码来源:SelendroidDriver.java

示例7: getContextHandles

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
@Override
public Set<String> getContextHandles() {
  Response response = execute(org.openqa.selenium.remote.DriverCommand.GET_CONTEXT_HANDLES);
  Object value = response.getValue();
  try {
    List<String> returnedValues = (List<String>) value;
    return new LinkedHashSet<String>(returnedValues);
  } catch (ClassCastException ex) {
    throw new WebDriverException("Returned value cannot be converted to List<String>: " + value,
        ex);
  }
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:13,代码来源:SelendroidDriver.java

示例8: readCallLog

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
public List<CallLogEntry> readCallLog() {
  Response response = execute("readCallLog");
  Object value = response.getValue();
  try {
    List<String> returnedLogs = (List<String>) value;
    List<CallLogEntry> logEntries = new ArrayList<CallLogEntry>(returnedLogs.size());
    for (String jsonLogEntry : returnedLogs) {
        logEntries.add(CallLogEntry.fromJson(jsonLogEntry));
    }
    return logEntries;
  } catch (ClassCastException ex) {
    throw new WebDriverException("Returned value cannot be converted to List<String>: " + value,
            ex);
  }
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:16,代码来源:SelendroidDriver.java

示例9: callExtension

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
public Object callExtension(String extensionMethod, Map<String, ?> parameters) {
  Map<String, Object> paramsWithHandler = Maps.newHashMap();
  paramsWithHandler.putAll(parameters);
  paramsWithHandler.put("handlerName", extensionMethod);
  Response response = execute("selendroid-handleByExtension", paramsWithHandler);
  return response.getValue();
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:8,代码来源:SelendroidDriver.java

示例10: getSessionDetails

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
/**
 * @return a map with values that hold session details.
 *
 */
public Map<String, Object> getSessionDetails() {
    Response response = execute(MobileCommand.GET_SESSION);
    return (Map<String, Object>) response.getValue();
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:9,代码来源:AppiumDriver.java

示例11: handleResponse

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
private static <T extends Object> T handleResponse(Response responce) {
    if (responce != null) {
        return (T) responce.getValue();
    }
    return null;
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:7,代码来源:CommandExecutionHelper.java

示例12: getCssValue

import org.openqa.selenium.remote.Response; //导入方法依赖的package包/类
@Override
public String getCssValue(String propertyName) {
	Response response = execute("getElementValueOfCssProperty",
			ImmutableMap.of("id", id, "propertyName", propertyName));
	return ((String) response.getValue());
}
 
开发者ID:qmetry,项目名称:qaf,代码行数:7,代码来源:QAFExtendedWebElement.java


注:本文中的org.openqa.selenium.remote.Response.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。