Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Error: missing EndIf

$
0
0
I've come across an error that I haven't been able to find a solution to.  Any help you can give would be great.

I am posting the entire .au3, but it is called from another file.  I split them up thinking it would be easier to navigate, make changes, and make additions.  The entire script is meant to automate testing in an EMR application the hospital I work for uses.  That way, any analyst can run the testing script, even though they may not be familiar with the section of the application being tested.

When I try and run the script, it opens this .au3 and gives me a "Error: missing EndIf" error.
The error is placed at the beginning of the function at the bottom of the script.

I can't find an if statement that hasn't been closed.

[ autoit ]         
#include-once #include <File.au3> Local $vCPActive, $vCP2Active, $vCP1 AutoItSetOption("SendKeyDelay", 300) ;300 milliseconds ToolTip("Checking Clinician Portal", 400, 300) Sleep(2000) ToolTip("") _FileWriteLog($vLog, "Checking Clinician Portal") Run("C:\Program Files\Internet Explorer\iexplore.exe") Sleep(4000) MsgBox(0, "HERO", "Click OK after Internet Explorer opens and finishes loading.") Sleep(500) $vCPActive = WinGetTitle("Intranet Homepage") If StringInStr($vCPActive, "Intranet Homepage") Then If $msg = $vDEVRadio Then      _ClinicianPortal("devweb2") ElseIf $msg = $vTESTRadio Then      _ClinicianPortal("scmwebt1") ElseIf $msg = $vPRODRadio Then      _ClinicianPortal("scmweb2") ElseIf $msg = $vTRAINRadio Then      _FileWriteLog($vLog, "Training Environment selected - there is no Clinician Portal in TRAIN.") EndIf Else _FileWriteLog($vLog, "Error: Internet Explorer did not open") EndIf Sleep(2000) Send("!fx") Sleep(1000) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ClinicianPortal ; Description ...: ; Syntax ........: _ClinicianPortal($vWebServer) ; Parameters ....: $vWebServer       - What webserver is Clinician Portal on? ; Return values .: None ; Author ........: Jerry Erickson ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _ClinicianPortal($vWebServer) Send("{TAB}http://" & $vWebServer & "/scp{ENTER}") Sleep(4000) MsgBox(0, "HERO", "Click OK after Clinician Portal page finishes loading.") Sleep(500) $vCP2Active = WinGetTitle("Sunrise Clinician Portal") If StringInStr($vCP2Active, "Sunrise Clinician Portal") Then Send($myUserName) Send("{TAB}") Send($myPassword) Send("{ENTER}") Sleep(5000) $vCP1 = MsgBox(36, "HERO", "Did Clinician Portal open?") If $vCP1 = 6 Then      _FileWriteLog($vLog, "Clinician Portal = Success") ElseIf $vCP1 = 7 Then      _FileWriteLog($vLog, "Clinician Portal = Failure") EndIf While WinActivate("HERO") = 0      WinActivate("HERO") WEnd Else _FileWriteLog($vLog, "Clinician Portal did not open.") EndIf EndFunc ;==>_ClinicianPortal

Viewing all articles
Browse latest Browse all 12506

Trending Articles