Change Timeout

Change the timeout for connection in seconds.

Arguments

Argument Type Default value Description
secondsintnull

Examples

Change Timeout 3

Change Wait Time

To give time for the mainframe screen to be "drawn" and receive the next commands, a "wait time" has been created, which by default is set to 0.5 seconds. This is a sleep applied AFTER the following keywords:

Arguments

Argument Type Default value Description
wait_timefloatnull

If you want to change this value, just use this keyword passing the time in seconds.

Examples

Change Wait Time 0.1
Change Wait Time 2

Change Wait Time After Write

To give the user time to see what is happening inside the mainframe, a "wait time after write" has been created, which by default is set to 0 seconds. This is a sleep applied AFTER sending a string in these keywords:

Arguments

Argument Type Default value Description
wait_time_after_writefloatnull

If you want to change this value, just use this keyword passing the time in seconds.

Note: This keyword is useful for debug purpose

Examples

Change Wait Time After Write 0.5
Change Wait Time After Write 2

Close Connection

Disconnect from the host.

Delete Char

Delete the character under the cursor. If you want to delete a character that is in another position, simply pass the coordinates ypos / xpos.

Arguments

Argument Type Default value Description
yposint, NoneNone
xposint, NoneNone

Co-ordinates are 1 based, as listed in the status area of the terminal.

Examples

Delete Char
Delete Char ypos=9 xpos=25

Delete Field

Delete the entire content of a field at the current cursor location and positions the cursor at beginning of field. If you want to delete a field that is in another position, simply pass the coordinates ypos / xpos of any part in the field.

Arguments

Argument Type Default value Description
yposint, NoneNone
xposint, NoneNone

Co-ordinates are 1 based, as listed in the status area of the terminal.

Examples

Delete Field
Delete Field ypos=12 xpos=6

Execute Command

Execute a x3270 command.

Arguments

Argument Type Default value Description
cmdstrnull

Examples

Execute Command Enter
Execute Command Home
Execute Command Tab
Execute Command PF(1)

Move Next Field

Move the cursor to the next input field. Equivalent to pressing the Tab key.

Move Previous Field

Move the cursor to the previous input field. Equivalent to pressing the Shift+Tab keys.

Open Connection

Create a connection to IBM3270 mainframe with the default port 23. To make a connection with the mainframe you only must inform the Host. You can pass the Logical Unit Name and the Port as optional.

Arguments

Argument Type Default value Description
hoststrnull
LUstr, NoneNone
portint23
extra_argsList[str], PathLike, NoneNone

If you wish, you can provide further configuration data to extra_args. extra_args takes in a list, or a path to a file, containing x3270 command line options. Entries in the argfile can be on one line or multiple lines. Lines starting with "/docs/libraries/3rd-party-libraries/mainframe3270#" are considered comments.

# example_argfile_oneline.txt
--accepthostname myhost.com
# example_argfile_multiline.txt
--accepthostname myhost.com
# this is a comment
--charset french

Please make sure the arguments you are providing are available for your specific x3270 application and version.

Examples

Open Connection Hostname
Open Connection Hostname LU=LUname
Open Connection Hostname port=992
${extra_args} Create List --accepthostname myhost.com --cafile ${CURDIR}/cafile.crt
Open Connection Hostname extra_args=${extra_args}
Open Connection Hostname extra_args=${CURDIR}/argfile.txt

Page Should Contain All Strings

Assert that all of the strings in a given list exist on the mainframe screen.

Arguments

Argument Type Default value Description
list_stringList[str]null
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Contain All Strings ${list_of_string}
Page Should Contain All Strings ${list_of_string} ignore_case=True
Page Should Contain All Strings ${list_of_string} error_message=New error message

Page Should Contain Any String

Assert that one of the strings in a given list exists on the mainframe screen.

Arguments

Argument Type Default value Description
list_stringList[str]null
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Contain Any String ${list_of_string}
Page Should Contain Any String ${list_of_string} ignore_case=True
Page Should Contain Any String ${list_of_string} error_message=New error message

Page Should Contain Match

Assert that the text displayed on the mainframe screen matches the given pattern.

Arguments

Argument Type Default value Description
txtstrnull
ignore_caseboolFalse
error_messagestr, NoneNone

Pattern matching is similar to matching files in a shell, and it is always case sensitive. In the pattern, * matches anything and ? matches any single character.

Note that for this keyword the entire screen is considered a string. So if you want to search for the string "something" and it is somewhere other than at the beginning or end of the screen, it should be reported as follows: *something*

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Contain Match *something*
Page Should Contain Match *so???hing*
Page Should Contain Match *someTHING* ignore_case=True
Page Should Contain Match *something* error_message=New error message

Page Should Contain String

Assert that a given string exists on the mainframe screen.

Arguments

Argument Type Default value Description
txtstrnull
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Contain String something
Page Should Contain String someTHING ignore_case=True
Page Should Contain String something error_message=New error message

Page Should Contain String X Times

Asserts that the entered string appears the desired number of times on the mainframe screen.

Arguments

Argument Type Default value Description
txtstrnull
numberintnull
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Contain String X Times something 3
Page Should Contain String X Times someTHING 3 ignore_case=True
Page Should Contain String X Times something 3 error_message=New error message

Page Should Match Regex

Fails if string does not match pattern as a regular expression. Regular expression check is implemented using the Python re module. Python's regular expression syntax is derived from Perl, and it is thus also very similar to the syntax used, for example, in Java, Ruby and .NET.

Arguments

Argument Type Default value Description
regex_patternstrnull

Backslash is an escape character in the test data, and possible backslashes in the pattern must thus be escaped with another backslash (e.g. \\d\\w+).

Page Should Not Contain All Strings

Fails if one of the strings in a given list exists on the mainframe screen. If one of the string are found, the keyword will raise a exception.

Arguments

Argument Type Default value Description
list_stringList[str]null
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Not Contain All Strings ${list_of_string}
Page Should Not Contain All Strings ${list_of_string} ignore_case=True
Page Should Not Contain All Strings ${list_of_string} error_message=New error message

Page Should Not Contain Any String

Assert that none of the strings in a given list exists on the mainframe screen. If one or more of the string are found, the keyword will raise a exception.

Arguments

Argument Type Default value Description
list_stringList[str]null
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Not Contain Any Strings ${list_of_string}
Page Should Not Contain Any Strings ${list_of_string} ignore_case=True
Page Should Not Contain Any Strings ${list_of_string} error_message=New error message

Page Should Not Contain Match

Assert that the text displayed on the mainframe screen does NOT match the given pattern.

Arguments

Argument Type Default value Description
txtstrnull
ignore_caseboolFalse
error_messagestr, NoneNone

Pattern matching is similar to matching files in a shell, and it is always case sensitive. In the pattern, * matches anything and ? matches any single character.

Note that for this keyword the entire screen is considered a string. So if you want to search for the string "something" and it is somewhere other than at the beginning or end of the screen, it should be reported as follows: *something*

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Not Contain Match *something*
Page Should Not Contain Match *so???hing*
Page Should Not Contain Match *someTHING* ignore_case=True
Page Should Not Contain Match *something* error_message=New error message

Page Should Not Contain String

Assert that a given string does NOT exists on the mainframe screen.

Arguments

Argument Type Default value Description
txtstrnull
ignore_caseboolFalse
error_messagestr, NoneNone

The assertion is case sensitive. If you want it to be case insensitive, you can pass the argument ignore_case=True.

You can change the exception message by setting a custom string to error_message.

Examples

Page Should Not Contain String something
Page Should Not Contain String someTHING ignore_case=True
Page Should Not Contain String something error_message=New error message

Page Should Not Match Regex

Fails if string does match pattern as a regular expression. Regular expression check is implemented using the Python re module. Python's regular expression syntax is derived from Perl, and it is thus also very similar to the syntax used, for example, in Java, Ruby and .NET.

Arguments

Argument Type Default value Description
regex_patternstrnull

Backslash is an escape character in the test data, and possible backslashes in the pattern must thus be escaped with another backslash (e.g. \\d\\w+).

Read

Get a string of length at screen co-ordinates ypos / xpos.

Arguments

Argument Type Default value Description
yposintnull
xposintnull
lengthintnull

Co-ordinates are 1 based, as listed in the status area of the terminal.

Example for read a string in the position y=8 / x=10 of a length 15:

${value} Read 8 10 15

Read All Screen

Read the current screen and returns all content in one string.

This is useful if your automation scripts should take different routes depending on a message shown on the screen.

Examples

${screen} Read All Screen
IF 'certain text' in '''${screen}'''
Do Something
ELSE
Do Something Else
END

Register Run On Failure Keyword

This keyword lets you change the keyword that runs on failure during test execution. The default is Take Screenshot, which is set on library import.

Arguments

Argument Type Default value Description
keywordstrnull

You can set None to this keyword, if you do not want to run any keyword on failure.

Examples

Register Run On Failure Keyword None # no keyword is run on failure
Register Run On Failure Keyword Custom Keyword # Custom Keyword is run on failure

Send Enter

Send an Enter to the screen.

Send PF

Send a Program Function to the screen.

Arguments

Argument Type Default value Description
PFstrnull

Examples

Send PF 3

Set Screenshot Folder

Set a folder to keep the html files generated by the Take Screenshot keyword.

Arguments

Argument Type Default value Description
pathstrnull

Note that the folder needs to exist before running your automation scripts. Else the images will be stored in the ${OUTPUT DIR} set by robotframework.

Examples

Set Screenshot Folder C:\\Temp\\Images

Take Screenshot

Generate a screenshot of the IBM 3270 Mainframe in a html format. The default folder is the log folder of RobotFramework, if you want change see the Set Screenshot Folder.

Arguments

Argument Type Default value Description
heightint410
widthint670

The Screenshot is printed in a iframe log, with the values of height=410 and width=670, you can change this values passing them to the keyword.

Examples

Take Screenshot
Take Screenshot height=500 width=700

Wait Field Detected

Wait until the screen is ready, the cursor has been positioned on a modifiable field, and the keyboard is unlocked.

Sometimes the server will "unlock" the keyboard but the screen will not yet be ready. In that case, an attempt to read or write to the screen will result in a 'E' keyboard status because we tried to read from a screen that is not ready yet.

Using this method tells the client to wait until a field is detected and the cursor has been positioned on it.

Wait Until String

Wait until a string exists on the mainframe screen to perform the next step. If the string does not appear in 5 seconds, the keyword will raise an exception. You can define a different timeout.

Arguments

Argument Type Default value Description
txtstrnull
timeoutint5

Examples

Wait Until String something
Wait Until String something timeout=10

Write

Send a string and Enter to the screen at the current cursor location.

Arguments

Argument Type Default value Description
txtstrnull

Examples

Write something

Write Bare

Send only the string to the screen at the current cursor location.

Arguments

Argument Type Default value Description
txtstrnull

Examples

Write Bare something

Write Bare In Position

Send only the string to the screen at screen co-ordinates ypos / xpos.

Arguments

Argument Type Default value Description
txtstrnull
yposintnull
xposintnull

Co-ordinates are 1 based, as listed in the status area of the terminal.

Examples

Write Bare in Position something 9 11

Write In Position

Send a string and Enter to the screen at screen co-ordinates ypos / xpos.

Arguments

Argument Type Default value Description
txtstrnull
yposintnull
xposintnull

Co-ordinates are 1 based, as listed in the status area of the terminal.

Examples

Write in Position something 9 11