CellGetIndex

Description

Searches the page for the text value specified in the text parameter and returns the index string for the first cell that contains the text. The index string is in the form of I/R/C, where I is the table index, R is the row number, and C is the column number. Other actions, such as CellClick, CellGetValue, and so on, use an index string to reference a specific cell.

Use the GetCellIndex button on the recorder toolbar to capture the text value and return a variable for the index.

Parameters

Parameter Description

text=value;

The text to look for on the page.

index=value;

Optional. If a value is entered it is used to start the search for the text. If the value is blank, PTF will start to look for the text in the index 1/1/1.

equal=value;

equal=true performs an exact match on the text to search for. This is the default for this optional parameter.

equal=false uses a LIKE statement when performing the search.

expected=value

Optional. If used, PTF writes either a Pass or Fail for the step in the test log based on whether a matching object exists. If this parameter is not included, then only step information is logged during execution.

For example:

expected=true Logs an error when the expected value is not found; logs Passed if found, logs Failed if not found.

expected=false Logs an error when the expected value is found; logs Passed if not found, logs Failed if found.

ret=&variable

The return value is an index string in the form of I/R/C, where I is the table index, R is the row number, and C is the column number.

For example:

ret=&CellIndex

Example

This example illustrates using the CellGetIndex to return a variable for the index, then creating a variable for the html cell that is to the left of the original cell using the sum function, and then clicking that cell. In this example PTF will start to look for the text in table 7, row 1, column 1.

Type Action Recognition Parameters Value

Browser

Start_Login

Browser

FrameSet

Link

Click

id=pttabpercontent

Browser

FrameSet

PtModFrame_##

HTMLTable

CellGetIndex

text=BI Publisher

index=7/1/1;equal=true;ret=&htmlindex

 

Variable

Set_Value

&htmlindex

sum(&htmlindex|-1|3|”/”)

HTMLTable

CellClick

index=&htmlindex

Page

Save

Name=PORTAL_HPWRK_HTMLAREA