'************************************************************************* ' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information ' regarding copyright ownership. The ASF licenses this file ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. ' '************************************************************************* '* '* short description : Put description here '* '\*********************************************************************** sub w_calculate Call tToolsCalculate1 Call tToolsCalculate2 Call tToolsCalculate3 end sub testcase tToolsCalculate1 Printlog "- Tools / calculation base functionality formula bar" Printlog " - Add" Call hNewDocument Call wTypeKeys "2+3+4+5" ToolsCalculate Call wTypeKeys " = " EditPaste if GetClipboardText <> "14" then Warnlog "Result of Add is not 14 but "+ GetClipboardText Printlog " - Subtract" Call wTypeKeys "101-3-4-155" ToolsCalculate Call wTypeKeys " = " EditPaste if GetClipboardText <> "-61" then Warnlog "Result of Subtract is not -61 but "+ GetClipboardText Printlog " - multiply" Call wTypeKeys "11*3*1" & DecimalSeparator & "5" ToolsCalculate Call wTypeKeys " = " EditPaste if GetClipboardText <> "49" & DecimalSeparator & "50" and GetClipboardText <> "49" & DecimalSeparator & "5" then Warnlog "Result of Multiply is not 49" & DecimalSeparator & "50 but " & GetClipboardText Printlog " - Division" Call wTypeKeys "111/3/2" ToolsCalculate Call wTypeKeys " = " EditPaste if GetClipboardText <> "18" & DecimalSeparator & "50" and GetClipboardText <> "18" & DecimalSeparator & "5" then Warnlog "Result of Multiply is not 18" & DecimalSeparator & "50 but " & GetClipboardText Printlog " - random with brackets" Call wTypeKeys "((12*2)/4" & DecimalSeparator & "5+3)-1" & DecimalSeparator & "5 " ToolsCalculate Call wTypeKeys " = " EditPaste if Left$(GetClipboardText,4) <> "6" & DecimalSeparator & "83" then Warnlog "Result of mixed calculation not 6" & DecimalSeparator & "83 but " & GetClipboardText Call hCloseDocument endcase ' ******************************************************************* testcase tToolsCalculate2 Printlog "- Tools / Calculate Basic functionality" Printlog " - Add" Call hNewDocument Call wTypeKeys "" Kontext "OL_SW_Rechenleiste" EingabeFeld.SetText "2+3+4+5" : EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "14" ) = FALSE then Warnlog "Result of Add not 14 but "+ GetClipboardText Printlog " - Subtract" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.SetText "101-3-4-155" : EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "-61" ) = FALSE then Warnlog "Result of Subtract not -61 but "+ GetClipboardText Printlog " - Multiply" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.SetText "11*3*1" & DecimalSeparator & "5" : EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "49" & DecimalSeparator & "5" ) = FALSE then Warnlog "Result of Multiplication not 49" & DecimalSeparator & "5 but " & GetClipboardText Printlog " - Division" Call wTypeKeys "" Kontext "OL_SW_Rechenleiste" EingabeFeld.SetText "111/3/2" : EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "18" & DecimalSeparator & "5" ) = FALSE then Warnlog "Result of Division not 18" & DecimalSeparator & "5 but " & GetClipboardText Printlog " - random with brackets" Call wTypeKeys "" Kontext "OL_SW_Rechenleiste" EingabeFeld.SetText "((12*2)/4" & DecimalSeparator & "5+3)-1" & DecimalSeparator & "5" : EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "6" & DecimalSeparator & "83" ) = FALSE then Warnlog "Result of mixed calculation not 6" & DecimalSeparator & "83 but " & GetClipboardText Call hCloseDocument endcase ' ******************************************************************* testcase tToolsCalculate3 Dim Fehlermeldung as String Printlog "- Tools / Calculate Basic functionality (formula button)" Call hNewDocument Printlog " - Sum (6)" Call wTypeKeys "" Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 1 ) Sleep 1 EingabeFeld.TypeKeys " (6)" : EingabeFeld.TypeKeys "" Sleep 1 if ErmittleErgebnis ( "6" ) = FALSE then Warnlog "Result is not 6 but "+ GetClipboardText Printlog " - Sum ( | )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 1 ) Sleep 1 EingabeFeld.TypeKeys " ( | )" : EingabeFeld.TypeKeys "" select case iSprache case 01 : Fehlermeldung = "** Expression is faulty **" case 03 : Fehlermeldung = "** Expressão incorrecta **" case 31 : Fehlermeldung = "** Foutieve expressie **" case 33 : Fehlermeldung = "** Expression errone **" case 34 : Fehlermeldung = "** Expresión errónea **" case 39 : Fehlermeldung = "** Errore nell'espressione **" case 45 : Fehlermeldung = "** Fejlagtigt udtryk **" case 46 : Fehlermeldung = "** Felaktigt uttryck **" case 48 : Fehlermeldung = "** Nieprawiedlowe wyralenie **" case 49 : Fehlermeldung = "** Fehlerhafter Ausdruck **" case else : Fehlermeldung = "" end select if ErmittleErgebnis ( Fehlermeldung ) = FALSE then if Fehlermeldung > "" then Warnlog "Result is not " + Fehlermeldung + " but " & GetClipboardText else QAErrorlog "** Errortext for this language not defined **" end if end if Printlog " - 1323,3 round 1" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "1323" & DecimalSeparator & "345 " Formel.Click Sleep 1 Call hMenuSelectNr ( 2 ) Sleep 1 EingabeFeld.TypeKeys " 1" : EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "1323" & DecimalSeparator & "3" ) = FALSE then Warnlog "Result is not 1323" & DecimalSeparator & "3 but " & GetClipboardText Printlog " - 10 + 20 PHD ( Percent )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "10 + 20 " Formel.Click Sleep 1 Call hMenuSelectNr ( 3 ) Sleep 1 EingabeFeld.TypeKeys "" if ErmittleErgebnis ( "10" & DecimalSeparator & "2" ) = FALSE then Warnlog "Result is not 10" & DecimalSeparator & "2 but " & GetClipboardText Printlog " - SQRT 144 ( Square Root )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 4 ) Sleep 1 EingabeFeld.TypeKeys " 144 " if ErmittleErgebnis ( "12" ) = FALSE then Warnlog "Result is not 12 but "+ GetClipboardText Printlog " - 4 POW 8 ( Power )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "4 " Formel.Click Sleep 1 Call hMenuSelectNr ( 5 ) Sleep 1 EingabeFeld.TypeKeys " 8 " if ErmittleErgebnis ( "65536" ) = FALSE then Warnlog "Result is not 65536 but "+ GetClipboardText Printlog "- Tools / Calculate Operators with formula button" Printlog " - 2 EQ 2 ( equal )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "2 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 2 ) Sleep 1 EingabeFeld.TypeKeys " 2 " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - 2 NEQ 2 ( not equal )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "2 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 3 ) Sleep 1 EingabeFeld.TypeKeys " 2 " if ErmittleErgebnis ( "0" ) = FALSE then Warnlog "Result is not 0 but "+ GetClipboardText Printlog " - 2 LEQ 3 ( Less than or equal )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "2 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 4 ) Sleep 1 EingabeFeld.TypeKeys " 3 " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - 2 GEO 2,0 ( greater than or equal )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "2 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 5 ) Sleep 1 EingabeFeld.TypeKeys " 2" & DecimalSeparator & "0 " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - 2 L 2 ( less )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "2 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 EingabeFeld.TypeKeys " 2 " if ErmittleErgebnis ( "0" ) = FALSE then Warnlog "Result is not 0 but "+ GetClipboardText Printlog " - 2,01 g 2 ( greater )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "2" & DecimalSeparator & "01 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 7 ) Sleep 1 EingabeFeld.TypeKeys " 2 " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - 0 OR 0 ( Boolean or )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "0 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 EingabeFeld.TypeKeys " 0 " if ErmittleErgebnis ( "0" ) = FALSE then Warnlog "Result is not 0 but "+ GetClipboardText Printlog " - 0 XOR 1 ( Boolean XOR )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "0 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 9 ) Sleep 1 EingabeFeld.TypeKeys " 1 " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - 1 AND 0 ( Boolean And )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "1 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 10 ) Sleep 1 EingabeFeld.TypeKeys " 0 " if ErmittleErgebnis ( "0" ) = FALSE then Warnlog "Result is not 0 but "+ GetClipboardText Printlog " - 0 NOT 0 ( Boolean Or )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" EingabeFeld.TypeKeys "0 " Formel.Click Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 Call hMenuSelectNr ( 11 ) Sleep 1 EingabeFeld.TypeKeys " 0 " if ErmittleErgebnis ( "0" ) = FALSE then Warnlog "Result is not 0 but "+ GetClipboardText Printlog "- Tools / Calculate Statistical function with formula button" Printlog " - mean 30|40|20 ( Mean )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 7 ) Sleep 1 Call hMenuSelectNr ( 1 ) Sleep 1 EingabeFeld.TypeKeys " 30|40|20 " if ErmittleErgebnis ( "30" ) = FALSE then Warnlog "Result is not 30 but "+ GetClipboardText Printlog " - min 1|1,01|1,001 ( Minimum )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 7 ) Sleep 1 Call hMenuSelectNr ( 2 ) Sleep 1 EingabeFeld.TypeKeys " 1|1" & DecimalSeparator & "01|1" & DecimalSeparator & "001 " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - max 1|1,01|1,001 ( Maximum )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 7 ) Sleep 1 Call hMenuSelectNr ( 3 ) Sleep 1 EingabeFeld.TypeKeys " 1|1" & DecimalSeparator & "01|1" & DecimalSeparator & "001 " if ErmittleErgebnis ( "1" & DecimalSeparator & "01" ) = FALSE then Warnlog "Result is not 1" & DecimalSeparator & "01 but "+ GetClipboardText Printlog "- Tools / Calculate Further functions" Printlog " - sin (PI/2) ( Sine )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 Call hMenuSelectNr ( 1 ) Sleep 1 EingabeFeld.TypeKeys " (PI/2) " if ErmittleErgebnis ( "1" ) = FALSE then Warnlog "Result is not 1 but "+ GetClipboardText Printlog " - cos (PI/2) ( Cosine )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 Call hMenuSelectNr ( 2 ) Sleep 1 EingabeFeld.TypeKeys " (PI/2) " if ErmittleErgebnis ( "0" ) = FALSE then Warnlog "Result is not 0 but "+ GetClipboardText Printlog " - tan (PI/2 - 0,001) ( Tangent )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 Call hMenuSelectNr ( 3 ) Sleep 1 EingabeFeld.TypeKeys " (PI/2 - 0" & DecimalSeparator & "001) " if ErmittleErgebnis ( "1000" ) = FALSE then Warnlog "Result is not 1000 but "+ GetClipboardText Printlog " - asin 1 ( Arc-Sine )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 Call hMenuSelectNr ( 4 ) Sleep 1 EingabeFeld.TypeKeys " 1 " if ErmittleErgebnis ( Fehlermeldung ) = FALSE then if Fehlermeldung > "" then Warnlog "Result is not " + Fehlermeldung + " but " & GetClipboardText else QAErrorlog "** Errortext for this language not defined **" end if end if wait 500 Printlog " - acos 0 ( Arc-Cosine )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 Call hMenuSelectNr ( 5 ) Sleep 1 EingabeFeld.TypeKeys " 0 " if ErmittleErgebnis ( "1" & DecimalSeparator & "57" ) = FALSE then Warnlog "Result is not 1" & DecimalSeparator & "57 but "+ GetClipboardText Printlog " - asin 1 ( Arc-Tangent )" Call wTypeKeys " " Kontext "OL_SW_Rechenleiste" Formel.Click Sleep 1 Call hMenuSelectNr ( 8 ) Sleep 1 Call hMenuSelectNr ( 6 ) Sleep 1 EingabeFeld.TypeKeys " 1 " if ErmittleErgebnis ( "0" & DecimalSeparator & "79" ) = FALSE then Warnlog "Result is not 0" & DecimalSeparator & "79 but "+ GetClipboardText Call hCloseDocument endcase