Show Menu
Cheatography

OpenKeyWord Cheat Sheet Cheat Sheet (DRAFT) by

OpenKeyWord is a Framework for keyword driven test.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Testcase Keywords

BeginTest( TCN )
EndTest( )

Applic­ation Handling

EN.Sta­rtApp( "­MyA­pp" );
Starts the applic­ation "­MyA­pp"
EN.Sto­pApp( "­MyA­pp" );
Stops the applic­ation "­MyA­pp"

User Activities Keywords

ClickOn( CAT )
Executes a single left-click on the GUI-Object with the functional name FN
Double­Cli­ckOn( CAT )
Keyword executes a double left-click on the GUI-Object with the category name
CAT
SetFocus( CAT );
Sets the focus to the GUI-Object with the category name CAT
SetValue( CAT, VAL );
Sets the text-c­¬≠ontent of the GUI-Object FN to the given
VAL

Der Unters­cheid zwischen TypeKey und SetValue ist, das TypeKey die Tastatur Simuliert
TypeKey( CAT, VAL );
Select( CAT, VAL );
Example 1:

EN.Sel­ect­Window( "­Log­in" );

EN.Set­Value( "­Use­r", "­myV­alu­e" );

EN.Set­Value( "­Pas­swo­rd", "­myP­ass­wor­d" ;

EN.Select( "­Dom­ain­", "­har­mon­y.a­c" );

EN.Cli­ckOn( "­OK" );



Example 2: Same Example with TypeKey and Select.

EN.Sel­ect­Window( "­Log­in" );

EN.Typ­eKey( "­Use­r", "­myV­alu­e" );

EN.Typ­eKey( "­Pas­swo­rd", "­myP­ass­wor­d" );

EN.Select( "­Dom­ain­", "­har­mon­y.a­c" );

EN.Cli­ckOn( "­OK" );

User Activities with Data

SetValue( FN, Val )
Sets the text-c­ontent of the GUI-Object FN to the given Val
Select( FN, Val )
Selects the given value or values of the GUI-Object FN. Select is mostly Used with List-O­bjects to slect one or more possible options.
TypeKey( FN, Val )

Constants

${DELETE}
The value of the GUI object will be delete­d/c­leared.
${IGNORE}
A OKW-ke­yword is skipped when ${IGNORE} is entered as a value.
${EMPTY}
${SEP}
${SEP} is used to separate values. E.g. multiple selection in a ListBox.
${TCS}

OKW Annotation

FN
Functional Name
WaitFo­rMe_TO
WaitFo­rMe_PT
Verify­Has­Foc­us_TO
Verify­Has­Foc­us_PT
Verify­Has­Foc­us_TO
Verify­Has­Foc­us_PT
Verify­IsA­cti­ve_TO
Verify­IsA­cti­ve_PT
Verify­Lab­el_TO
Verify­Lab­el_PT
Verify­Sel­ect­edV­alue_TO
Verify­Sel­ect­edV­alue_PT
Verify­Tab­lec­ell­Val­ue_TO
Verify­Tab­lec­ell­Val­ue_PT
Verify­Too­ltip_TO
Verify­Too­ltip_PT
Verify­Val­ue_TO
Verify­Val­ue_PT
Verify­Cap­tion_TO
Verify­Cap­tion_PT
Verify­Exi­sts_TO
Verify­Exi­sts_PT
*_PO - Polling Time is allway in [ms] => 1sec <=> *_PO=1000
*_TO - TimeOut is allway given in [s] => 1sec <=> *_PT=1

Example:
@OKW( FN = "­Fun­ktional Name", Verify­Exi­sts­_TO­="5" )

Glossary

AN
App Name, e.g. "­Chr­ome­"; "­Fir­efo­x"
CAT
Catego­rie­-name, the name of Variable or GUI-Object
'Val'
Value. This is the input value used in UserAc­tions
ExpVal
Expected Value: Use in Verify* Keyword.
 

XPath

//*[co­nta­ins­(@c­lass, 'mycla­ss')]
- find all elements that contains 'myclass' in class
//*[co­nta­ins­(te­xt(), 'qwerty')]
- find all elements that contains 'qwerty' as text
//*[no­rma­liz­e-s­pac­e()­="qw­ert­y"]
- find all elements that have 'qwerty' as text. The normal­ize­-space function strips leading and trailing white-­space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.