Web Vuser Functions (WEB) > Alphabetical List of Web Vuser Functions > web_image

web_image

Emulates a mouse click on the image that is defined by the attributes.

C Language

int web_image( constchar *StepName, <List of Attributes>, [EXTRARES, <List of Resource Attributes>,] LAST );

Java Language

int object.image( String StepName, String [] argumentList );
Argument
Description
object
An expression evaluating to an object of type WebApi. Usually web for Java. See also Function and Constant Prefixes.
StepName
The name of the image in the tree view. Also used as the transaction name for automatic transactions.
List of Attributes – both client–side and server–side image maps.
ALT: The ALT attribute of the IMG element that defines the image. The ALT attribute appears in a bubble when pointing to the associated image, and as text before the image is loaded.
SRC: The SRC attribute of the IMG element that defines the image. Alternatively, the file name of the image. For example, button.gif. You can also specify SRC/SFX to specify a suffix for the image's path. All strings with that suffix will be considered a match.
Frame: The name of the frame in which you recorded the operation. The name of the frame is the value of the name attribute of the FRAME element.
ALT is recorded if it exists, otherwise SRC is recorded. Ordinal is used for resolving ambiguity in both cases.
ResourceByteLimit: Click ResourceByteLimit for more information.
List of Attributes –
client–side image maps only.
The following attributes apply to client–side image maps only:
AreaAlt: the ALT attribute of the area to click.
AreaOrdinal: the serial number of the area to click.
MapName: the name of the map related to the image.
List of Attributes –
server–side image maps only.
The following attributes apply to server–side image maps only (although the coordinates of the click are not "attributes", the attribute format is used for them):
Xcoord: The X coordinate of the click on the image.
Ycoord: The Y coordinate of the click on the image.
EXTRARES
A demarcation parameter indicating that the next parameter will be a list of resource attributes.
List of Resource Attributes
LAST
A marker that indicates the end of the argument list.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

Parameterization

The following argument(s) can be parameterized using standard parameterization: List of Attributes

General Information

The web_image action function emulates a mouse click on the image that is defined by the attributes. This function may be executed only in the context of a previous operation.

web_image is recorded only when VuGen is in HTML–based recording mode (see VuGen's Recording Options).

The web_image function supports both client–side and server–side image maps. See the List of Attributes above for those attributes that are specific to client–side and server–side image maps.

Examples of non–HTML–generated resources are .gif and .jpg images. The List of Resource Attributes are only inserted when the recording option for these resources is set at "Record within the current script step". This is the default setting. Refer to the Virtual User Generator User Guide.

The HTTP header can be modified to pass additional information about the request to the server. Using HTTP headers you can, for example, allow other content types in the response such as compressed files, or you can request a Web page only on certain conditions. To modify the HTTP header in the request see web_add_header. To modify all subsequent requests, see web_add_auto_header.

The function web_image is supported for all Web scripts.