2017 October Release

Examples for Using the "Keypress" ActionPermanent link for this heading

Here you will find some common examples how you can use the "Keypress" action in your test (see chapter "Keypress" Action”).

Quick SearchPermanent link for this heading

You can not only carry out a quick search by using the "Quicksearch" action (see chapter “"Quicksearch" Action”) but also by using "Keypress" for carrying out each step of the quick search manually:

Example

<Execution action="Click" location="PAGES.Explore.Category" />
<Execution action="Keypress" location="WINDOWS[LAST]" value="InsertKey" />
<Execution action="Set" location="PAGES.Explore.Category" value="*" />
<Execution action="Keypress" location="Next" value="ReturnKey" />

Rename an Object by Using the F2 KeyPermanent link for this heading

You can rename an object in an object list (or change the entry of a cell) by slecting the row/cell and pressing the F2 key. Then you can change the value of the selected cell and press the Return key for submitting the change. Afterwards, you can check if the renaming has been executed correctly.

Example

<Execution action="Click" location='PAGES.Explore.Object List["Name"=="Fabasoft Folio"]' />
<Execution action="Keypress" location="WINDOWS[LAST]" value="F2Key" />
<Execution action="Set" location='PAGES.Explore.Object List["Name"=="Fabasoft Folio"].Name' value="Fabasoft Folio 2009 Fall Release" />
<Execution action="Keypress" location="WINDOWS[LAST]" value="Returnkey" />
<Set parameter="Renamed" location='PAGES.Explore.Object List["Name"=="Fabasoft Folio 2009 Fall Release"]' eval="Exists" />
<Validation ok="{~Renamed~}" />

Use F6 to Enter the Current DatePermanent link for this heading

If you select a date field in Fabasoft Folio/eGov-Suite and press the F6 key, the current date is entered. This can also be imitated by a "Keypress" action. Afterwards you can check if the date has been set correctly. As it might probably happen that the test is executed around midnight the current date (which means the datenow parameter) might change between two executions. Therefore, you have to make sure that in the validation you also pay attention that the current date might be the next day.

Example

<Execution action="Click" location="PAGES.Explore.Date of Contract" />
<Execution action="Keypress" location="WINDOWS[LAST]" value="F6Key" />
<Set parameter="DateOfContract" location="PAGES.Explore.Date of Contract" />
<Validation ok="{~DateOfContract~}=={~datenow~}||{~DateOfContract~}+1=={~datenow~}" />

Test Shortcuts in Fabasoft FolioPermanent link for this heading

In Fabasoft Folio you can also use shortcuts, e.g. for opening a menu. These shortcuts are displayed in the tooltip if you move the mouse pointer over the control (e.g. button or tab). Here is an example for using shortcuts:

Example

<!-- Click the "New" button in the button bar of the object list -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="NKey" options="AltKey" />
<Execution action="Click" location="PAGS.Explore.What do you want to create?.More" />
<Execution action="Click" location="PAGS.Explore.What do you want to create?[0].Note Object" />
<Execution action="Keypress" location="PAGS.Explore.Name" value="ReturnKey" />
<Execution action="Set" location="PAGS.Explore.Name" value="Notes" />
<Execution action="Keypress" location="PAGS.Explore.Name" value="ReturnKey" />
<Execution action="Click" location='PAGES.Explore.Object List["Name"=="Notes"]' />
<!-- Open the "Edit" menu -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="EKey" options="AltKey" />
<Execution action="Click" location="MENU.Copy" />
<!-- Click the "Paste Duplicate" button in the button bar of the object list -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="PKey" options="AltKey" />
<!-- Click the "Paste Original" button in the button bar of the object list -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="GKey" options="AltKey" />
<!-- Click the "Edit Properties" button in the button bar of the object list -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="DKey" options="AltKey" />
<Execution action="Click" location="PAGES.Explore.BUTTONBAR.Next" />
<Execution action="Click" location="PAGES.Explore.Object List[0]" />
<Execution action="Click" location="PAGES.Explore.Object List[LAST]" options="ShiftKey" />
<!-- Open the "Object" menu -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="OKey" options="AltKey" />
<Execution action="Click" location="MENU.Destroy" />
<!-- Click the "Yes to all" button -->
<Execution action="Keypress" location="WINDOWS[LAST]" value="YKey" options="AltKey" />