CaptainBeardsEyesBeard Posted May 22, 2018 Share Posted May 22, 2018 Hi This is a straight copy and paste of my folder and opening a project on another computer. And yet I get this on my laptop (works fine on dev pc) Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 22, 2018 Author Share Posted May 22, 2018 OK I think I found the problem. I have all the includes in my main file but for the separate tests seem to fail unless I add the includes to them as well. Why does it execute fine with the includes on the main file on my pc but demand the includes be declared again in each header file? Link to comment Share on other sites More sharing options...
BrewManNH Posted May 22, 2018 Share Posted May 22, 2018 Without seeing the code, that would be impossible to answer. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
TheXman Posted May 22, 2018 Share Posted May 22, 2018 https://www.autoitscript.com/autoit3/docs/keywords/include.htm CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Zedna Posted May 22, 2018 Share Posted May 22, 2018 Do you have the same (installed) version of AutoIt on both computers? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 22, 2018 Author Share Posted May 22, 2018 I have 3.5.4 on my working pc (where the project works no problems) And 3.7.3 on my laptop (where the same project doesn't work). I'm also noticing that global variables I create in my Main script aren't recognised in my header file function scripts EG. Local $EliteWindow = "Elite Enterprise 3.11" ; create a variable to point at different versions of Elite WinActivate($EliteWindow) ; Focus Elite window Did they change how the scripts work or something? Link to comment Share on other sites More sharing options...
Zedna Posted May 22, 2018 Share Posted May 22, 2018 On your screenshot is mentioned version 3.3.14.5. Install the same version of AutoIt on both computers and then there will be no problems. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
BrewManNH Posted May 22, 2018 Share Posted May 22, 2018 How about not making us guess and post your code that doesn't work so we can SEE what you did wrong? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 23, 2018 Author Share Posted May 23, 2018 (edited) Here's one of the header files expandcollapse popup;/******************************************************************************************************/ ;/*TEST2_Add_A_Matter******/ ;/******************************************************************************************************/ $TestCount =1 Func Test2_Add_A_Matter($ClientNumber,$MatterNumber) While 1 Local $ActiveTitle = WinGetTitle("[ACTIVE]") if StringInStr($ActiveTitle, "Not Responding") then ;Wait 10 seconds before killing the application Sleep(10000) if StringInStr($ActiveTitle, "Not Responding") then ;restart elite ProcessClose("Enterprise.exe") Else EndIf Else Local $TestResult = False WinActivate("Elite Enterprise 3.11") ;/****** Click on Billing Manager/MasterFiles/Matter**/ Navigation_Click_Billing_Manager() Navigation_Click_BillingManager_MasterFiles() Navigation_Click_BillingManager_MasterFiles_Matter() Sleep(10000) WinWait("[CLASS:SysTreeView32]", "", 10) Navigation_Click_BillingManager_MasterFiles_Matter_MatterField() Sleep(10000) WinWait("[CLASS:SysTreeView32]", "", 10) Send($ClientNumber) Sleep(2000) SEND("{TAB}") Sleep(2000) SEND("{TAB}") Sleep(2000) SEND($MatterNumber) Sleep(2000) SEND("{TAB}") Local $Success = WinWait("[CLASS:Static2]", "", 10) Sleep(3000) ; Retrieve the text of the Description box on the Matter/General Info 1 page ;Local $NewMatterNumber = ControlGetText($hWnd, "", "ThunderRT6TextBox87") ControlClick("", "", "[CLASS:ABSDActiveBarDockWND; INSTANCE:1]", "Left", 1, 78, 39) SEND("^s") WinWait("[CLASS:Static2]", "", 10) Sleep(3000) ; Wait for Window that confirms Matter was successfully saved Local $hWnd = WinWait("Elite Enterprise Matter", "", 10) ;obtain the text in that window which should be "Successfully Saved Matter MATTERNUMBER" Local $RecordSaveSuccess = ControlGetText($hWnd, "", "Static2") WinWaitActive("Elite Enterprise Matter") sleep(500) ControlClick("Elite Enterprise Matter", "", "[CLASS:Button; INSTANCE:1;]") ;click ok Navigation_Click_OK_To_Saved_Matter() ; click ok WinClose ( "Eliter Enterprise Matter") ; close window ;Check inside the string pulled from the Elite Enterprise Matter window to see if it contains Successfully saved ;If it does : pass test and output to a text file if StringInStr($RecordSaveSuccess, "Successfully saved") then MsgBox($MB_SYSTEMMODAL, "Test" & $TestCount & " Result", "Test Passed, Matter Saved" & $RecordSaveSuccess, 4) FileWrite($hFilehandle, @CRLF & "Test" & $TestCount & " Create a new matter using " & $MatterNumber & "as a model matter Ensure matter saves " & $RecordSaveSuccess) FileWrite($hFilehandle, @CRLF & "Test" & $TestCount & " Create a new matter using " & $MatterNumber & "as a model matter Ensure Matter has incremented Test Passed") Else MsgBox($MB_SYSTEMMODAL, "Test" + $TestCount & " Result", "Test Failed", 4) FileWrite($hFilehandle, @CRLF & "Test" & $TestCount & " Create a new matter using " & $MatterNumber & "as a model matter Ensure matter saves Test Failed") FileWrite($hFilehandle, @CRLF & "Test" & $TestCount & " Create a new matter using " & $MatterNumber & "as a model matter Ensure Matter has incremented Test Failed") EndIf Sleep(5000) WinActivate($EliteWindow) Navigation_Click_BillingManager_MasterFiles() Navigation_Click_Billing_Manager() EndIf ExitLoop WEnd EndFunc Edited May 23, 2018 by CaptainBeardsEyesBeard Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 23, 2018 Author Share Posted May 23, 2018 (edited) Now here's the Main file (I have about 20 headers in this project) expandcollapse popup; Test includes #include "C:\EliteAutomation\Framework\Tests\TEST2_Add_A_Matter.au3" #include "C:\EliteAutomation\Framework\Tests\Test3_Search_For_A_Matter_And_Verfiy_The_Description_Box.au3" #include "C:\EliteAutomation\Framework\Tests\Test4_Click_GeneralInfo2_And_Verify_Against_An_existing_Matter.au3" #include "C:\EliteAutomation\Framework\Tests\Test5_Verify_Billing2_Tab.au3" #include "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3" #include "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3" #include "C:\EliteAutomation\Framework\Tests\Test8_Add_A_Client.au3" #include "C:\EliteAutomation\Framework\Tests\Test9_Create_A_Voucher.au3" #include "C:\EliteAutomation\Framework\Tests\Finalise_Time_On_A_Matter.au3" ;Navigation Includes #include "C:\EliteAutomation\Framework\Navigation\Navigation.au3" #include "C:\EliteAutomation\Framework\Navigation\BillingManager\MasterFiles\Navigation_Client.au3" #include "C:\EliteAutomation\Framework\Navigation\BillingManager\MasterFiles\Navigation_Timekeeper.au3" #include "C:\EliteAutomation\Framework\Navigation\Navigation_Accounts_Payable.au3" ;Page functions #include "C:\EliteAutomation\Framework\PageFunctions\PageFunctions_BillingManagerMaster.au3" ;Handle Elite functions #include "C:\EliteAutomation\Framework\HandleEliteCrashFunction\StartEliteAsAdmin.au3" ;AutoIT includes #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> $TestCount =1 $RandomClientNumber = 45 ;/******************************************************/ ;/*****************Main Program*************************/ ;/******************************************************/ AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKey', 10) Sleep(300) Global $EliteWindow = "Elite Enterprise 3.11" ; create a variable to point at different versions of Elite WinActivate($EliteWindow) ; Focus Elite window Global $sFileName = "C:\EliteAutomation\TestResults.txt" ; Open file - deleting any existing content Global $hFilehandle = FileOpen($sFileName, $FO_OVERWRITE) ;/************ Working Tests ******************/ Test8_Add_A_Client("TestClient5" + Random(100,10000,1) + "", "Bread Test Client", "Redacted", "Redacted", "Redacted", "Redacted", "Redacted", "01/01/2018", "01/01/2025","10", "ZZZ", "Redacted", "Redacted", "Redacted", "Redacted", "04", "N" ) Exit Edited May 23, 2018 by CaptainBeardsEyesBeard Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 23, 2018 Author Share Posted May 23, 2018 And here's the compiler errors expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\EliteAutomation\Framework\TestMain.au3" /UserParams +>09:50:38 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0 Keyboard:00000809 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0809) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\EliteAutomation\Framework\TestMain.au3 "C:\EliteAutomation\Framework\Tests\TEST2_Add_A_Matter.au3"(74,29) : warning: $hFilehandle: possibly used before declaration. FileWrite($hFilehandle, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST2_Add_A_Matter.au3"(86,25) : warning: $EliteWindow: possibly used before declaration. WinActivate($EliteWindow) ~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test4_Click_GeneralInfo2_And_Verify_Against_An_existing_Matter.au3"(34,8) : error: syntax error ElseIf Then ~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3"(1,10) : error: can't open include file "C:\EliteAutomation\Navigation\BillingManager\Time\Navigation_BillingManager_Time.au3". #include "C:\EliteAutomation\Navigation\BillingManager\Time\Navigation_BillingManager_Time.au3" ~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3"(2,10) : error: can't open include file "C:\EliteAutomation\Navigation\BillingManager\Time\TimeEntryWindow\Navigation_Time_Entry_Window.au3". #include "C:\EliteAutomation\Navigation\BillingManager\Time\TimeEntryWindow\Navigation_Time_Entry_Window.au3" ~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3"(54,20) : warning: $DateBarPassed: possibly used before declaration. Send($DateBarPassed) ~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test9_Create_A_Voucher.au3"(13,15) : warning: $VendorID: possibly used before declaration. Send($VendorID) ~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\TestMain.au3"(40,30) : error: AutoItSetOption() called with illegal argument 1: "SendKey". AutoItSetOption('SendKey', 10) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3"(54,20) : error: $DateBarPassed: undeclared global variable. Send($DateBarPassed) ~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test9_Create_A_Voucher.au3"(13,15) : error: $VendorID: undeclared global variable. Send($VendorID) ~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3"(11,39) : error: Navigation_Click_Billing_Manager_Time(): undefined function. Navigation_Click_Billing_Manager_Time() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3"(12,49) : error: Navigation_Click_Billing_Manager_Time_TimeEntry(): undefined function. Navigation_Click_Billing_Manager_Time_TimeEntry() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3"(43,70) : error: Navigation_Click_Billing_Manager_Time_TimeEntry_Tickbox_For_Timecard(): undefined function. Navigation_Click_Billing_Manager_Time_TimeEntry_Tickbox_For_Timecard() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\TEST6_Add_Time_To_A_Matter.au3"(44,65) : error: Navigation_Click_Billing_Manager_Time_TimeEntry_Action_Dropdown(): undefined function. Navigation_Click_Billing_Manager_Time_TimeEntry_Action_Dropdown() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3"(64,77) : error: Navigation_Click_BillingManager_MaterFiles_Timekeeper_AccountingInformation(): undefined function. Navigation_Click_BillingManager_MaterFiles_Timekeeper_AccountingInformation() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3"(66,91) : error: Navigation_Click_BillingManager_MaterFiles_Timekeeper_AccountingInformation_EffectiveDate(): undefined function. Navigation_Click_BillingManager_MaterFiles_Timekeeper_AccountingInformation_EffectiveDate() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3"(71,90) : error: Navigation_Click_BillingManager_MaterFiles_Timekeeper_AccountingInformation_StandardRate(): undefined function. Navigation_Click_BillingManager_MaterFiles_Timekeeper_AccountingInformation_StandardRate() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Test7_Add_A_TimeKeeper.au3"(76,61) : error: Navigation_Click_BillingManager_MaterFiles_Timekeeper_Rates(): undefined function. Navigation_Click_BillingManager_MaterFiles_Timekeeper_Rates() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Finalise_Time_On_A_Matter.au3"(14,62) : error: Navigation_TabAndTickCheckBox_Billing_Manager_Time_TimeEntry(): undefined function. Navigation_TabAndTickCheckBox_Billing_Manager_Time_TimeEntry() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\EliteAutomation\Framework\Tests\Finalise_Time_On_A_Matter.au3"(70,76) : error: Navigation_Tab_Exit_Timecard_And_Timecard_Adjustment_Group_Finalise_Cancel(): undefined function. Navigation_Tab_Exit_Timecard_And_Timecard_Adjustment_Group_Finalise_Cancel() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\EliteAutomation\Framework\TestMain.au3 - 16 error(s), 4 warning(s) !>09:50:39 AU3Check ended. Press F4 to jump to next error.rc:2 +>09:50:39 AutoIt3Wrapper Finished. >Exit code: 2 Time: 1.106 Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 23, 2018 Author Share Posted May 23, 2018 It seems like a combination of not recognising global variables I declare on the Main.au3, not recognising the functions I've included in the Navigation.au3 and not recognising stuff like AutoItSetOption('SendKey', 10) Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted May 23, 2018 Author Share Posted May 23, 2018 OK I managed to find the copy of AutoIT on my pc. I uninstalled the current version then installed that one (3.5.4) and my tests work fine! Does this mean my tests are going to break with every version of AutoIT? Link to comment Share on other sites More sharing options...
Zedna Posted May 23, 2018 Share Posted May 23, 2018 1 hour ago, CaptainBeardsEyesBeard said: Does this mean my tests are going to break with every version of AutoIT? Generally: Yes. You have to read changelogs and especially section "Script breaking changes". Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now