using LoginPI.Engine.ScriptBase; using System; public class openEMR : ScriptBase { void Execute() { /* -Disclaimer: This workload is provided as-is and might need further configuration and customization to work successfully in each unique environment. For further Professional Services-based customization please consult with the Login VSI Support and Services team. Please refer to the Help Center section "Application Customization" for further self-help information regarding workload crafting and implementation. -Run the workload against the "target" using Script Editor to ensure it will work before uploading it and testing with it -Go through the workload to understand what it's doing. Comment out any unneeded app tests (code blocks) or add on any needed functional testing -Workload version and changelist: --V1.0 | original -Leave Application running compatibility: true Read me, and to-dos: -There are vars at the top of this script which need to be set This script will: -Start OpenEMR server services -Start iexplore and navigate to the defined OpenEMR homepage -Log in with a defined OpenEMR user account -Open Calendar page -Open Appointment Search interface -Open Flow Board page -Open Recall Board page -Open Messages page -Open Fees --> Billing page -Open Procedures --> Providers page -Open Reports --> Clients --> List page -Open Patient Finder --> search for a defined patient --> open the record -Log out of the OpenEMR user -Close out of iexplore -Stop OpenEMR services This script was created with the following versions, settings, and assumptions: -iexplore 11 (ver 11.557.17763.0) -OpenEMR Version Number: v5.0.1 (4) -Assumes the Calendar is the home/landing page the OpenEMR account opens to (this can be configred in the OpenEMR account's settings) -Assumes after the patient query -> patient load functions are performed, there are no modal dialogs which open when the patient is loaded. If the "target" patient does yield a modal dialog when loaded, however, this script can be altered to accommodate that. Please refer to Login PI's documentation on workload creation and implementation. */ // Declare string vars // var for address for OpenEMR homepage string openEMRHomepageAddress = "< OpenEMR Home >{enter}"; // var for the path to the executables which start and stop the OpenEMR server services, respectively string pathToOpenEMRInvoker = ""; string pathToOpenEMRCloser = ""; // vars for OpenEMR username and password string userName = ""; string passWord = ""; // vars for OpenEMR patient to search for // var for the string to be typed in the patient search bar (e.g. "sm" for Smith) string PatientNameType = ""; //var for the string to be looked for in the patient results (to be clicked on when found in the results pane (this is case and punctuation sensitive)) string PatientNameResult = ""; // Closing out of the OpenEMR server services; gracefully, if already running (to prepare for new test) ShellExecute(pathToOpenEMRCloser,waitForProcessEnd:true,timeout:60); // Making sure iexplore isn't already running ShellExecute("cmd /c taskkill /f /im iexp*",waitForProcessEnd:true,timeout:20); // Starting the OpenEMR server services ShellExecute(pathToOpenEMRInvoker,waitForProcessEnd:false); FindWindow(className : "Win32 Window:ConsoleWindowClass", title : "C:\\xampp\\xampp_start.exe", processName : "httpd",timeout:60); // Starting iexplore in InPrivate mode START(mainWindowTitle:"*InPrivate*",timeout:20); MainWindow.Focus(); MainWindow.Maximize(); // Navigating to the OpenEMR homepage var inPrivatePane = MainWindow.FindControlWithXPath(xPath : "Pane:Frame Tab/Pane:TabWindowClass/Pane:Shell DocObject View/Pane:Internet Explorer_Server/Pane",timeout:60); inPrivatePane.Focus(); MainWindow.FindControlWithXPath(xPath : "Pane:ReBarWindow32/Pane:Address Band Root/Pane:AddressDisplay Control/Edit",timeout:60); var addressBar = MainWindow.FindControlWithXPath(xPath : "Pane:ReBarWindow32/Pane:Address Band Root/Pane:AddressDisplay Control/Edit"); addressBar.Click(); Type(openEMRHomepageAddress,cpm:9999); StartTimer(name:"LoginPageLoad"); var openEMRIexploreWindow = FindWindow(className : "Win32 Window:IEFrame", title : "OpenEMR Login*", processName : "iexplore",timeout:60); // Typing in username and password; submitting webform for login var usernameField = openEMRIexploreWindow.FindControl(className : "Edit", title : "Username:",timeout:60); StopTimer(name:"LoginPageLoad"); var passwordField = openEMRIexploreWindow.FindControl(className : "Edit", title : "Password:",timeout:60); var loginButton = openEMRIexploreWindow.FindControl(className : "Button", title : "Login",timeout:60); usernameField.Click(); Type(userName,cpm:9999); passwordField.Click(); Type(passWord,cpm:9999); loginButton.Click(); StartTimer(name:"LandingPageLoad"); // Waiting for landing page to load -> clicking on Calendar button var CalendarToolbarButton = openEMRIexploreWindow.FindControlWithXPath(xPath : "Pane:Frame Tab/Pane:TabWindowClass/Pane:Shell DocObject View/Pane:Internet Explorer_Server/Pane/Text",timeout:60); StopTimer(name:"LandingPageLoad"); CalendarToolbarButton.Click(); StartTimer(name:"CalendarPageLoad"); // Waiting for appointment search magnifying glass button to appear var AppointmentSearchMagnifyingGlassButton = openEMRIexploreWindow.FindControl(className : "Hyperlink", title : "Search Appointment",timeout:60); StopTimer(name:"CalendarPageLoad"); AppointmentSearchMagnifyingGlassButton.Click(); StartTimer(name:"AppointmentSearchPageLoaded"); // Waiting for appointment search page to show openEMRIexploreWindow.FindControl(className : "Text", title : "between",timeout:60); StopTimer(name:"AppointmentSearchPageLoaded"); // Clicking on Flow Board -> waiting for it to show var FlowBoardPageButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Flow Board",timeout:60); FlowBoardPageButton.Click(); StartTimer(name:"FlowBoardPageLoaded"); openEMRIexploreWindow.FindControl(className : "Pane", title : "Flow Board",timeout:60); StopTimer(name:"FlowBoardPageLoaded"); // Clicking on Recall Board -> waiting for it to show var RecallBoardButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Recall Board",timeout:60); RecallBoardButton.Click(); StartTimer(name:"RecallBoardPageLoaded"); openEMRIexploreWindow.FindControl(className : "Pane", title : "Recall Board",timeout:60); StopTimer(name:"RecallBoardPageLoaded"); // Clicking on Messages -> waiting for it to show var MessagesPageButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Messages",timeout:60); MessagesPageButton.Click(); StartTimer(name:"MessageCenterPageLoaded"); openEMRIexploreWindow.FindControl(className : "Pane", title : "Message Center",timeout:60); StopTimer(name:"MessageCenterPageLoaded"); // Clicking on Fees -> Billing button -> waiting for it to show var FeesButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Fees",timeout:60); FeesButton.Click(); var BillingButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Billing",timeout:60); BillingButton.Click(); StartTimer(name:"BillingManagerPageLoaded");openEMRIexploreWindow.FindControl(className : "Button", title : "X12 OPTIONS",timeout:60); StopTimer(name:"BillingManagerPageLoaded"); // Clicking on Procedures -> Providers button -> waiting for it to show var ProceduresButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Procedures",timeout:60); ProceduresButton.Click(); var ProvidersButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Providers",timeout:60); ProvidersButton.Click(); StartTimer(name:"ProcedureProvidersPageLoaded"); openEMRIexploreWindow.FindControl(className : "Pane", title : "Procedure Providers",timeout:60); StopTimer(name:"ProcedureProvidersPageLoaded"); // Clicking on Reports -> Clients -> List button -> waiting for it to show var ReportsButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Reports",timeout:60); ReportsButton.Click(); var ClientsButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Clients"); ClientsButton.Click(); var ListButton = openEMRIexploreWindow.FindControl(className : "Text", title : "List",timeout:60); ListButton.Click(); StartTimer(name:"PatientListPageLoad"); var PatientListPageLoadPane = openEMRIexploreWindow.FindControl(className : "Pane", title : "Patient List",timeout:60); StopTimer(name:"PatientListPageLoad"); // Patient Finder Magnifying Glass button -> Clicking -> Waiting for page loading (custom timer encapsulation) -> Clicking on "Search all columns" -> Typing PatientNameType var -> Looking for PatientNameResult var (custom timer encapsulation; around query loading) var PatientFinderMagnifyingGlassButton = openEMRIexploreWindow.FindControlWithXPath(xPath : "Pane:Frame Tab/Pane:TabWindowClass/Pane:Shell DocObject View/Pane:Internet Explorer_Server/Pane/Hyperlink[1]",timeout:60); PatientFinderMagnifyingGlassButton.Click(); StartTimer(name:"PatientFinderPageLoadSearchField"); var SearchAllColumnsField = openEMRIexploreWindow.FindControl(className : "Edit", title : "Search all columns:",timeout:60); StopTimer(name:"PatientFinderPageLoadSearchField"); SearchAllColumnsField.Click(); Type(PatientNameType,cpm:9999); StartTimer(name:"PatientQueryResultPresent"); var PatientQueryResultPresent = openEMRIexploreWindow.FindControl(className : "Text", title : PatientNameResult,timeout:60); StopTimer(name:"PatientQueryResultPresent"); // Opening the patient record; encapsulating the detection of the resultant page loading within a custom timer PatientQueryResultPresent.DoubleClick(); StartTimer(name:"PatientRecordPageLoaded"); // Verifying the Patient Record Page Loaded openEMRIexploreWindow.FindControl(className : "Hyperlink", title : "Billing (expand)",timeout:60); StopTimer(name:"PatientRecordPageLoaded"); // Click current user -> Logout button -> look for username field var CurrentUserButton = openEMRIexploreWindow.FindControlWithXPath(xPath : "Pane:Frame Tab/Pane:TabWindowClass/Pane:Shell DocObject View/Pane:Internet Explorer_Server/Pane/Text[14]",timeout:60); CurrentUserButton.Click(); var LogoutButton = openEMRIexploreWindow.FindControl(className : "Text", title : "Logout",timeout:60); LogoutButton.Click(); StartTimer(name:"UserHasLoggedOut"); // Looking for username field (at the login page) openEMRIexploreWindow.FindControl(className : "Edit", title : "Username:",timeout:60); StopTimer(name:"UserHasLoggedOut"); // Closing out of iexplore; gracefully STOP(timeout:15); // Killing iexplore if it doesn't close ShellExecute("cmd /c taskkill /f /im iexp*",waitForProcessEnd:true,timeout:20); // Closing out of the OpenEMR server services; gracefully ShellExecute(pathToOpenEMRCloser,waitForProcessEnd:true,timeout:60); } }