Sei sulla pagina 1di 5

-----------------------------

Automation API
Version 1.0
Table of Contents

1. Introduction............................................................................................................................................................1
2. User Stories.............................................................................................................................................................1
3. Functional Specification..........................................................................................................................................1
3.1 GetPictureLocation..........................................................................................................................................1
3.2 GetTextCoordinates.........................................................................................................................................2

Revision History
Name Date Reason For Changes Version
Bui Phan Bao Nghi November 11, 1
2013
1. Introduction

2. User Stories

- As a TA users, they want to:


o Automation API publicizes functions to get the location of a picture and get the coordinates of a text.

3. Functional Specification

3.1 GetPictureLocation
Prototype:

- TARect GetPictureLocation(string picture, TARect rect, int index)

Description

- Return the location (left, top, width, height) of the picture on the screen, the window or the control.

Return Value

- Return a TARect value (left, top, width, height) of the location of the picture:
o On the screen: if users call this action from interface IAbtImageProcessor
o On the window: if users call this action from interface IAbtEntity
o On the control: if users call this action from interface IAbtElement

Note:

- Supported Classes: IAbtEntity,IAbtElement and IAbtImageProcessor


- IAbtImageProcessor: new interface that supports image actions in case IAbtEntity and IAbtElement are not
set.

Requirement argument

- Picture: The name of the saved picture to be checked

Optional argument

- rect: Specifies a rectangular area in the searching area. This rectangular area is used with the searching area
to specify the searching range. The rect argument consists of four values and the values must be separated
with commas. Four values are:
o Left: Specifies the horizontal coordinate (pixel) of the rectangular area. The coordinate is relative to
the top left corner of the searching area.
o Top: Specifies the vertical coordinate (pixel) of the rectangular area. The coordinate is relative to the
top left corner of the searching area.
o Width: Specifies the width value of the rectangular area. The default value is specified as the width
of the control argument minus the value specified for the left argument.
o Height: Specifies the height value of the rectangular area. The default value is specified as the height
of the control argument minus the value specified for the top argument.

GetTextCoordinates| Functional Specification 1


- Index: Specifies which picture to check, in case there are several identical pictures in the searching area. The
index is one-based and the default value is 1. Specifically, TestArchitect looks for the desired picture in the
left-to-right, and then top-to-bottom orders.

Negative case

- Cannot find the picture  return null

3.2 GetTextCoordinates
Prototype:

- TAPoint GetTextCoordinates(string text, TARect rect, int index)

Description

- Return the left and top coordinates of the desired text on the screen, the window or the control.

Return Value

- Return the TAPoint value (left,top) of the desired text on the screen:
o On the screen: if users call this action from interface IAbtImageProcessor
o On the window: if users call this action from interface IAbtEntity
o On the control: if users call this action from interface IAbtElement

Note:

- Supported Classes: IAbtEntity,IAbtElement and IAbtImageProcessor


- IAbtImageProcessor: new interface that supports image actions in case IABtEntity and IAbtElement are not
set.
- TAPoint: new interface that return two values X and Y.

Requirement argument

- Text: The content of the text to be checked

Optional argument

- rect: Specifies a rectangular area in the searching area. This rectangular area is used with the searching area
to specify the searching range. The rect argument consists of four values and the values must be separated
with commas. Four values are:
o Left: Specifies the horizontal coordinate (pixel) of the rectangular area. The coordinate is relative to
the top left corner of the searching area.
o Top: Specifies the vertical coordinate (pixel) of the rectangular area. The coordinate is relative to the
top left corner of the searching area.
o Width: Specifies the width value of the rectangular area. The default value is specified as the width
of the control argument minus the value specified for the left argument.
o Height: Specifies the height value of the rectangular area. The default value is specified as the height
of the control argument minus the value specified for the top argument.
- Index: Specifies which text to check, in case there are several identical texts in the searching area. The index
is one-based and the default value is 1. Specifically, TestArchitect looks for the desired text in the left-to-
right, and then top-to-bottom orders.

GetTextCoordinates| Functional Specification 2


Negative case

- Cannot find the text  return null

GetTextCoordinates| Functional Specification 3

Potrebbero piacerti anche