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


Java Command类代码示例

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


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

示例1: send

import org.openqa.selenium.remote.Command; //导入依赖的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.Command; //导入依赖的package包/类
@Override
public Response execute(Command command) throws IOException {
    Response response;
    if (DriverCommand.QUIT.equals(command.getName())) {
        response = grid.execute(command);
    } else {
        response = node.execute(command);
    }
    return response;
}
 
开发者ID:RationaleEmotions,项目名称:talk2grid,代码行数:11,代码来源:CustomCommandExecutor.java

示例3: execute

import org.openqa.selenium.remote.Command; //导入依赖的package包/类
@Override public Response execute(Command command) throws IOException, WebDriverException {
    if (DriverCommand.NEW_SESSION.equals(command.getName()) && service != null) {
        service.start();
    }

    try {
        return super.execute(command);
    } catch (Throwable t) {
        Throwable rootCause = Throwables.getRootCause(t);
        if (rootCause instanceof ConnectException
            && rootCause.getMessage().contains("Connection refused")
            && service != null) {
            if (service.isRunning()) {
                throw new WebDriverException("The session is closed!", t);
            }

            if (!service.isRunning()) {
                throw new WebDriverException("The appium server has accidentally died!", t);
            }
        }
        Throwables.propagateIfPossible(t);
        throw new WebDriverException(t);
    } finally {
        if (DriverCommand.QUIT.equals(command.getName()) && service != null) {
            service.stop();
        }
    }
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:29,代码来源:AppiumCommandExecutor.java

示例4: populate

import org.openqa.selenium.remote.Command; //导入依赖的package包/类
protected RestishHandler populate(RestishHandler handler, Command command) {
  for (Map.Entry<String, ?> entry : command.getParameters().entrySet()) {
    try {
      PropertyMunger.set(entry.getKey(), handler, entry.getValue());
    } catch (Exception e) {
      throw new WebDriverException(e);
    }
  }
  return handler;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:11,代码来源:ResultConfig.java

示例5: beforeEvent

import org.openqa.selenium.remote.Command; //导入依赖的package包/类
public void beforeEvent(Command command) {
    if (command.getName().equalsIgnoreCase(DriverCommand.CLICK)) {
        System.out.println("Before click");
    }
}
 
开发者ID:mach6,项目名称:oscon-aus-2016,代码行数:6,代码来源:DemoEventFiringListener.java

示例6: afterEvent

import org.openqa.selenium.remote.Command; //导入依赖的package包/类
public void afterEvent(Command command) {
    if (command.getName().equalsIgnoreCase(DriverCommand.CLICK)) {
        System.out.println("After click");
    }
}
 
开发者ID:mach6,项目名称:oscon-aus-2016,代码行数:6,代码来源:DemoEventFiringListener.java


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