Logic Plug-in

<< Click to Display Table of Contents >>

RayQC > 8.0 > User Guide > Plug-ins > Internal Plug-ins 

Logic Plug-in

The Logic plug-in deals with functionality required to convert, compare and analyze values.

 

Function Summary

BooleanToString

CompareValue

ContainsString

FormatString

GetRegexGroup

GetStringLength

GetSubString

GetTrimmedString

GetTrimmedStringStatic

InvertBoolean

MatchRegex

NumberInRange

StringToString

TrimWhitespace

 

 

Function Details

BooleanToStringMulti-OptionData Field

Converts a boolean value or checkpoint result to a defined string. This function can for example be used to map a checkpoint state to a multi-option item.

Usable in combination with elements of type Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Value

boolean

default: true

 
 

Boolean value, which is in most cases defined as reference to a checkpoint result.

 

Options:

enabled: the text entered into the True Text parameter is returned.

disabled: the text entered into the False Text parameter is returned.

TrueText

string

The text that is returned if value is true.

 

Example:

64bit Architecture

FalseText

string

The text that is returned if value is false.

 
Example:

32bit Architecture

 

 

CompareValueCheckpoint

Compares two values, which may be required to compare the result of two checklist elements, or a static string with an element result.

Usable in combination with elements of type Checkpoint.

 

Input parameters

Name

Type

Description & Examples

Actual

string

 
 

The first string for the comparison.

 

Example:

Raynet GmbH

Expected

string

The second string for the comparision.

 

Example:

raynet gmbh

Case sensitive

boolean

optional

default: true

Defines if the comparision has to be executed case sensitive or not.

 
Example:

enabled = The 2 strings used as example above will be regarded to 

be different.

disabled = The 2 strings used as example above will be regarded 

to match.

Custom Failure Comment

string

optional

The default failure comment to the Checkpoint element

can be exchanged by this string if required.
 

Example:

This environment requires the manufacturer property and the author

attribute of the summary information stream to match case sensitive.

 

 

ContainsStringCheckpoint

Searches for a specific string in another string.

Usable in combination with elements of type Checkpoint.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The haystack to search within.

 

Example:

RayQC is a rule-based tool used to create and

execute test criteria in one or more checklists.

Search

string

The needle to search for.

 

Example:

Checklist

Case Sensitive

boolean

optional

default: true

Defines if the needle has to be found exactly in the case usage as

defined within the parameter search.

 
Example:

enabled = The needle defined above will not be found within the 

example haystack.

disabled = The needle defined above will be found within the

example haystack.

Custom Failure Comment

string

optional

The default failure comment of the Checkpoint element

can be exchanged by this string if required.

 
Example:

Case sensitive substring search did not lead to a match.

 

 

FormatStringMulti-OptionData Field

Formats a string by replacing up to five defined placeholders with arguments. A placeholder has the format '#x#' with 'x' as number of the argument.

Usable in combination with elements of type Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The string that contains the placeholders that have to be replaced.

 

Example:

The value of the #1# property is defined as #2#.

Replacement

#<number>#

string

The value of the #1# property is defined as #2#

The value inserted into the original text at the position of the placeholder #number#.

 

Example:

manufacturer

 

GetRegexGroupMulti-OptionData Field

Checks whether a text matches the pattern defined by a singular regular expression group.

Usable in combination with elements of type Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The string that is scanned for regular expression matching.

 

Example:

uninst_myApp.lnk

Regular Expression

string

The regular expression pattern the string is evaluated by.

The sample pattern given below matches the sample text above.

 

Example:

First test value is "AAA" and the second test value 

is "111".

 

"(.*?)"

 

Gets the string between first quote.

 

tip

Tip:

Please take a look at the Regular Expressions section for further information and assistance regarding regex usage.

 

GetStringLengthMulti-OptionData Field

Returns the length of a string. If no string is given, 0 is returned

Usable in combination with elements of types  Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

optional

default: none

 
 

String of which the characters are counted.

 

Example:

The following sentence has a string length of 161:

RayQC increases the quality of your software deployments through multi-level and standardized test plans by relieving the manual testing tasks of your workforce.

 

 

GetSubStringMulti-OptionData Field

Returns a substring from a given text.

Usable in combination with elements of type Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The string that is used to extract the substring from. The samples used here lead to the extraction of the substring experience.

 

Example:

Improve end-user experience and productivity!

First

integer

minimum value: 1

The first letter, number or special character that is returned as part of the substring. The counted value starts at 1 for the first character of the Text parameter. Using negative numbers will count from the end (true for both numbers)

 

Example:

17

Last

integer

 

 

 

The last letter, number or special character that is returned as part of the sub-

string. The counted value starts at 1 for the first sign of the Text parameter.

 
Be aware:

The value given for this parameter may not be lower than the value entered for the parameter First.

 
Example:

26

 

 

GetTrimmedStringMulti-OptionData Field

Returns a sub-string as result of trimming a given string.

Usable in combination with elements of types Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The string that is trimmed. The sample used here lead to the extraction of the trimmed sub-string 00FF00.

 

Example:

<#!"§00FF00+#>

TrimStart

string

optional

default: none

The set of characters that is trimmed from the start of the original string. The order of the characters is not important.

 

Example:

<§"!#

TrimEnd

string

optional

default: none

 

The combination of signs that is trimmed from the end of the original string. The order of the characters is not important.

 
Example:

#+>

 

 

GetTrimmedStringStaticMulti-OptionData Field

Returns a sub-string as result of trimming a given string.

Usable in combination with elements of types Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The string that is trimmed. The sample used here lead to the extraction of the trimmed substring 00FF00+#.

 

Example:

<#!"§00FF00>

TrimStart

string

optional

default: none

The set of characters that is trimmed from the start of the original string.

 

Be aware:

The order of characters is important. The given string must exactly match the start of the Text parameter, otherwise the trimming will not be executed.

 

Example:

<#!"§

TrimEnd

string

optional

default: none

 

 

 

The combination of signs that is trimmed from the end of the original string.

 
Be aware:

The order of characters is important. The given string must exactly match the end of the Text parameter, otherwise the trimming will not be executed.

 
Example:

#+>

 

 

InvertBooleanCheckpoint

Inverts a boolean (Yes / No) value.

Usable in combination with elements of type Checkpoint.

 

Input parameters

Name

Type

Description & Examples

Value

boolean

 
 

The original boolean value that has to be inverted.

 

Be aware:
Inverting a boolean value does not invert the value expectation of the element itself! If Yes is the expected result of the Checkpoint element that has been extended by this plug-in function, and the Value parameter is set to No, the element will evaluate to false / No. Please make sure to double-check expected element evaluation results whenever expected value and / or invert boolean are applied to any Checkpoint element!  

 

Options:

enabled: is inverted to No

disabled: is inverted to Yes

 

 

MatchRegexCheckpoint

Checks if the text contains a string that matches a specific regular expression. If FailureComment is not set, it is autmatically generated by the plug-in.

Usable in combination with elements of type Checkpoint.

 

Input parameters

Name

Type

Description & Examples

Text

string

optional
 

The string that is scanned for regular expression matching.

 

Example:

uninst_myApp.lnk

Regular Expression

string

The regular expression pattern the string is evaluated by. The sample pattern given below matches the sample text above.

 

Example:

^unins(|t|tall)\d*\.(cif|cfg|dat|dll|ini|exe|xml|lnk)$

FailureComment

string

optional

default: generated by RayQC

The failure comment that is presented if the regular expression does not match the Text parameter.

 

tip

Tip:

Please take a look at the Regular Expressions section for further information and assistance regarding regex usage.

 

 

NumberInRangeCheckpoint

Checks the input parameter for being an integer in the given range.

Usable in combination with elements of type Checkpoint.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The numeric string that is evaluated regarding its integer value.

 

Example:

15

F

HexValue

boolean

optional

default: false

If a hexadecimal number is given as input parameter value, this option has to be set to true in order to achieve a valid check result.

 

Options:

enabled = checkbox is activated: input is evaluated as hexadecimal value.

disabled = checkbox is not activated: input is evaluated as integer value.

Minimum

integer

optional

default: none

The minimum value of the checked range (inclusive).

 
Example:

14 leads to evaluation to true for the sample Text parameter  defined

above.

15 leads to evaluation to true for the sample Text parameter  defined

above.

16 leads to evaluation to false for the sample Text parameter  defined

above.

Maximum

integer

optional

default: none

The maximum value of the checked range (inclusive).

 
Example:

14 leads to evaluation to false for the sample Text parameter defined

above.

15 leads to evaluation to true for the sample Text parameter  defined

above.

16 leads to evaluation to true for the sample Text parameter  defined

above.

 

 

StringToStringMulti-OptionData Field

Converts string to string based on two synchronized lists. Lists are regarded to be synchronized if they have the same number of elements. This function can for example be used to map plug-in function output to multi-option values.

Usable in combination with elements of type Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Value to convert

formatted string

The string that will be converted

 

Example:

There is a bird in the tree.

 

Following the example lists below, this string will be converted to “There is a cat in the house.”

From

formatted string

The list of strings that is being searched for. List items have to be separated by the pipe sign (|).

 

Example:

Bird|Mouse|Dog|Tree

To

string

The list of strings that will replace the strings defined in parameter From.

 
Example:

Cat|Home|Fish|House

 

TrimWhitespaceMulti-OptionData Field

Returns the given text with trimmed whitespaces.

Usable in combination with elements of types Data Field and Multi-Option.

 

Input parameters

Name

Type

Description & Examples

Text

string

 
 

The string that has to be trimmed. The sample string has both: 1 leading and 1 trailing whitespace.

 

Example:

" This is a sample text! "

TrimStart

boolean

optional

default: false

Decides whether or not leading whitespaces have to be trimmed.

 

Options:

enabled = checkbox is active: leading whitespaces are trimmed.

disabled = checkbox is not active: leading whitespaces are not trimmed.

TrimEnd

boolean

optional

default: false

Decides whether or not trailing whitespaces have to be trimmed.

 

Options:

enabled = checkbox is active: trailing whitespaces are trimmed.

disabled = checkbox is not active: trailing whitespaces are not trimmed.