Home > Winrunner > WinRunner Functions

WinRunner Functions

Database Functions

db_check

This function captures and compares data from a database.
Note that the checklist file (arg1) can be created only during record.
arg1 – checklist file.

db_connect

This function creates a new connection session with a database.
arg1 – the session name (string)
arg2 – a connection string
for example “DSN=SQLServer_Source;UID=SA;PWD=abc123″

db_disconnect

This function disconnects from the database and deletes the session.
arg1 – the session name (string)

db_dj_convert

This function executes a Data Junction conversion export file (djs).
arg1 – the export file name (*.djs)
arg2 – an optional parameter to override the output file name
arg3 – a boolean optional parameter whether to
include the headers (the default is TRUE)
arg4 – an optional parameter to
limit the records number (-1 is no limit and is the default)

db_execute_query

This function executes an SQL statement.
Note that a db_connect for (arg1) should be called before this function
arg1 – the session name (string)
arg2 – an SQL statement
arg3 – an out parameter to return the records number.

db_get_field_value

This function returns the value of a single item of an executed query.
Note that a db_execute_query for (arg1) should be called before this function
arg1 – the session name (string)
arg2 – the row index number (zero based)
arg3 – the column index number (zero based) or the column name.

db_get_headers

This function returns the fields headers and fields number of an executed query.
Note that a db_execute_query for (arg1) should be called before this function
arg1 – the session name (string)
arg2 – an out parameter to return the fields number
arg3 – an out parameter to return the concatenation
of the fields headers delimited by TAB.

db_get_last_error

This function returns the last error message of the last ODBC operation.
arg1 – the session name (string)
arg2 – an out parameter to return the last error.

db_get_row

This function returns a whole row of an executed query.
Note that a db_execute_query for (arg1) should be called before this function
arg1 – the session name (string)
arg2 – the row number (zero based)
arg3 – an out parameter to return the concatenation
of the fields values delimited by TAB.

db_record_check

This function checks that the specified record exists in the
database.Note that the checklist file (arg1) can be created
only using the Database Record Verification Wizard.
arg1 – checklist file.
arg2 – success criteria.
arg3 – number of records found.

db_write_records

This function writes the records of an executed query into a file.
Note that a db_execute_query for (arg1) should be called before this function
arg1 – the session name (string)
arg2 – the output file name
arg3 – a boolean optional parameter whether to
include the headers (the default is TRUE)
arg4 – an optional parameter to
limit the records number (-1 is no limit and is the default).

ddt_update_from_db

This function updates the table with data from database.
arg1 – table name.
arg2 – query or conversion file (*.sql ,*.djs).
arg3 (out) – num of rows actually retrieved.
arg4 (optional) – max num of rows to retrieve (default – no limit).

GUI-Functions

GUI_add

This function adds an object to a buffer
arg1 is the buffer in which the object will be entered
arg2 is the name of the window containing the object
arg3 is the name of the object
arg4 is the description of the object

GUI_buf_get_desc

This function returns the description of an object
arg1 is the buffer in which the object exists
arg2 is the name of the window containing the object
arg3 is the name of the object
arg4 is the returned description

GUI_buf_get_desc_attr

This function returns the value of an object property
arg1 is the buffer in which the object exists
arg2 is the name of the window
arg3 is the name of the object
arg4 is the property
arg5 is the returned value

GUI_buf_get_logical_name

This function returns the logical name of an object
arg1 is the buffer in which the object exists
arg2 is the description of the object
arg3 is the name of the window containing the object
arg4 is the returned name

GUI_buf_new

This function creates a new GUI buffer
arg1 is the buffer name

GUI_buf_set_desc_attr

This function sets the value of an object property
arg1 is the buffer in which the object exists
arg2 is the name of the window
arg3 is the name of the object
arg4 is the property
arg5 is the value

GUI_close

This function closes a GUI buffer
arg1 is the file name.

GUI_close_all

This function closes all the open GUI buffers.

GUI_delete

This function deletes an object from a buffer
arg1 is the buffer in which the object exists
arg2 is the name of the window containing the object
arg3 is the name of the object (if empty, the window will be deleted)

GUI_desc_compare

This function compares two phisical descriptions (returns 0 if the same)
arg1 is the first description
arg2 is the second description

Advertisements
  1. Indumathi
    July 6, 2009 at 3:11 pm

    Hi,

    Now only i saw your blog. It is very useful . Thanks.. Keep updating….

    you can get more resources like ebooks, articles, Documents, from http://www.macrotesting.com..

    Indu..
    http://indumathi.wordpress.com

  2. October 19, 2014 at 8:42 am

    Good day I am so excited I found your web site, I really
    found you by mistake, while I was researching on Askjeeve for something else,
    Regardless I am here now and would just like to say many thanks
    for a marvelous post and a all round thrilling blog
    (I also love the theme/design), I don’t have time to
    look over it all at the minute but I have bookmarked it and also included your RSS
    feeds, so when I have time I will be back to read a great deal more, Please do
    keep up the awesome work.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: