com.greenpepper.extensions.selenium.SeleniumCommand Maven / Gradle / Ivy
The newest version!
package com.greenpepper.extensions.selenium;
import com.greenpepper.reflect.Message;
import com.thoughtworks.selenium.CommandProcessor;
/**
* SeleniumCommand class.
*
* @author oaouattara
* @version $Id: $Id
*/
public class SeleniumCommand extends Message {
private String commandName;
private CommandProcessor commandProcessor;
/**
* Constructor for SeleniumCommand.
*
* @param commandProcessor a {@link com.thoughtworks.selenium.CommandProcessor} object.
* @param commandName a {@link java.lang.String} object.
*/
public SeleniumCommand(CommandProcessor commandProcessor, String commandName) {
this.commandProcessor = commandProcessor;
this.commandName = commandName;
}
/** {@inheritDoc} */
@Override
public int getArity() {
return 0;
}
/** {@inheritDoc} */
@Override
public String send(String... args) throws Exception {
return commandProcessor.doCommand(commandName, args);
}
}