Package jp.vmi.selenium.selenese.command
Class AbstractCommand
- java.lang.Object
-
- jp.vmi.selenium.selenese.command.AbstractCommand
-
- All Implemented Interfaces:
ArgumentInfo,ICommand
- Direct Known Subclasses:
AddCollection,AddLocationStrategy,AddSelection,AddToCollection,AllowNativeXpath,AltKeyDown,AltKeyUp,AnswerOnNextNativeAlert,AnswerOnNextPrompt,Assert,Assertion,AssignId,AttachFile,BlockEndImpl,BlockStartImpl,BuiltInCommand,CaptureEntirePageScreenshot,Check,ChooseCancelOnNextConfirmation,ChooseCancelOnNextNativeAlert,ChooseCancelOnNextPrompt,ChooseOkOnNextConfirmation,ChooseOkOnNextNativeAlert,Click,ClickAt,Close,Comment,ContextMenu,ControlKeyDown,ControlKeyUp,CreateCookie,DeleteAllVisibleCookies,DeleteCookie,DeselectPopUp,DoubleClick,DoubleClickAt,DragAndDrop,DragAndDropToObject,Echo,EditContent,ExecuteAsyncScript,ExecuteScript,FireEvent,Focus,GoBack,GotoIf,Gotolabel,Highlight,Include,KeyDown,KeyPress,KeyUp,Label,MetaKeyDown,MetaKeyUp,Nop,Open,OpenWindow,Pause,Refresh,RemoveAllSelections,RemoveSelection,RepeatIf,Rollup,Run,RunScript,Select,SelectFrame,SelectPopUp,SelectWindow,SetCursorPosition,SetSpeed,SetTimeout,SetWindowSize,ShiftKeyDown,ShiftKeyUp,Store,StoreJson,Submit,Type,TypeKeys,Uncheck,UseXpathLibrary,WaitForCondition,WaitForPageToLoad,WaitForPopUp,WindowFocus,WindowMaximize
public abstract class AbstractCommand extends Object implements ICommand
Base implementation of command.
-
-
Constructor Summary
Constructors Constructor Description AbstractCommand(int index, String name, String[] args, ArgumentType... argTypes)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddScreenshot(String path, String label)Add screenshot image.String[]convertLocators(String[] args)Deprecated.Resultexecute(Context context, String... curArgs)Execute the command.protected abstract ResultexecuteImpl(Context context, String... curArgs)Locator[]extractLocators(String[] args)Extract locators from arguments.String[]getArguments()Get command arguments.BlockStartgetBlockStart()Get beginning-of-block command.intgetIndex()Get index in selenese script file (1 origin).StringgetName()Get command name.ResultgetResult()Get the command result.List<Screenshot>getScreenshots()Get list of screenshot images.String[]getSource()Get source elements.StartLoopgetStartLoop()Get beginning-of-loop command.String[]getVariableResolvedArguments(SourceType sourceType, VarsMap varsMap)Get command arguments where variables resolved.booleanmayUpdateScreen()May the command update screen?voidsetBlockStart(BlockStart blockStart)Set beginning-of-block command.voidsetSideCommand(SideCommand sideCommand)Set side command.voidsetStartLoop(StartLoop startLoop)Set beginning-of-loop command.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jp.vmi.selenium.selenese.ArgumentInfo
getArgumentCount
-
Methods inherited from interface jp.vmi.selenium.selenese.command.ICommand
isNativeAlertHandler
-
-
-
-
Constructor Detail
-
AbstractCommand
public AbstractCommand(int index, String name, String[] args, ArgumentType... argTypes)Constructor.- Parameters:
index- command index.name- command name.args- command args.argTypes- command argument types.
-
-
Method Detail
-
getSource
public final String[] getSource()
Description copied from interface:ICommandGet source elements.
-
getIndex
public int getIndex()
Description copied from interface:ICommandGet index in selenese script file (1 origin).
-
getArguments
public String[] getArguments()
Description copied from interface:ICommandGet command arguments.- Specified by:
getArgumentsin interfaceICommand- Returns:
- command arguments.
-
getVariableResolvedArguments
public String[] getVariableResolvedArguments(SourceType sourceType, VarsMap varsMap)
Description copied from interface:ICommandGet command arguments where variables resolved.- Specified by:
getVariableResolvedArgumentsin interfaceICommand- Parameters:
sourceType- source type.varsMap- map of variables.- Returns:
- arguments.
-
convertLocators
@Deprecated public String[] convertLocators(String[] args)
Deprecated.Description copied from interface:ICommandConvert locators from arguments.- Specified by:
convertLocatorsin interfaceICommand- Parameters:
args- the command arguments.- Returns:
- converted locators.
-
extractLocators
public Locator[] extractLocators(String[] args)
Description copied from interface:ICommandExtract locators from arguments.- Specified by:
extractLocatorsin interfaceICommand- Parameters:
args- the command arguments.- Returns:
- extracted parsed locators.
-
mayUpdateScreen
public boolean mayUpdateScreen()
Description copied from interface:ICommandMay the command update screen?- Specified by:
mayUpdateScreenin interfaceICommand- Returns:
- true if the command may update screen.
-
execute
public final Result execute(Context context, String... curArgs)
Description copied from interface:ICommandExecute the command.Note: set the command result to testCase in this method.
-
getResult
public Result getResult()
Description copied from interface:ICommandGet the command result.
-
setBlockStart
public void setBlockStart(BlockStart blockStart)
Description copied from interface:ICommandSet beginning-of-block command.- Specified by:
setBlockStartin interfaceICommand- Parameters:
blockStart- beginning-of-block command.
-
getBlockStart
public BlockStart getBlockStart()
Description copied from interface:ICommandGet beginning-of-block command.- Specified by:
getBlockStartin interfaceICommand- Returns:
- beginning-of-block command.
-
setStartLoop
public final void setStartLoop(StartLoop startLoop)
Description copied from interface:ICommandSet beginning-of-loop command.- Specified by:
setStartLoopin interfaceICommand- Parameters:
startLoop- beginning-of-loop command.
-
getStartLoop
public final StartLoop getStartLoop()
Description copied from interface:ICommandGet beginning-of-loop command.- Specified by:
getStartLoopin interfaceICommand- Returns:
- beginning-of-loop command.
-
addScreenshot
public void addScreenshot(String path, String label)
Description copied from interface:ICommandAdd screenshot image.- Specified by:
addScreenshotin interfaceICommand- Parameters:
path- image path.label- image label.
-
getScreenshots
public List<Screenshot> getScreenshots()
Description copied from interface:ICommandGet list of screenshot images.- Specified by:
getScreenshotsin interfaceICommand- Returns:
- list of image path of sreenshot.
-
setSideCommand
public void setSideCommand(SideCommand sideCommand)
Description copied from interface:ICommandSet side command.- Specified by:
setSideCommandin interfaceICommand- Parameters:
sideCommand- SIDE command.
-
-