Package: maximo-gui-connector
Maximo GUI Connector for PythonA small package that uses Selenium to automate the most basic operations you could do on IBM Maximo Asset ManagementInstallationInstall thepackageby typingpip install maximo-gui-connectorDownload thechromedriver(seethis note) matching your browser version and put it intoPATHYou canimportthe package into your script and use it like this:importmaximo_gui_connectorasMGCYOUR_USERNAME=""YOUR_PASSWORD=""YOUR_GROUP=""if__name__=="__main__":try:maximo=MGC.MaximoAutomation({"debug":False,"headless":False})maximo.login(YOUR_USERNAME,YOUR_PASSWORD)maximo.goto_section("changes")maximo.setFilters({"status":"!=REVIEW","owner group":YOUR_GROUP})data=maximo.getAllRecordsFromTable()print(data)maximo.logout()exceptExceptionase:print(e)finally:print()input("Press any key to stop the script and close chrome")"""So that if the error occurs before the `maximo` object is initialized,`maximo.close()` doesn't throw a `NameError` exception"""try:maximo.close()exceptNameErrorase:pass(In)complete ReferenceThis section is still work in progress, so some properties/methods could miss.NameDescriptionMaximoAutomation(CONFIG)Instantiates the Maximo object. Takes a dictionary as an argument. Possible configuration:NameDescriptiondebugIfTrue, the logger will contain more information useful for debugging purposes.Defaults toFalseheadlessIfTrue, the browser will start hidden.Defaults toFalseurlThe URL of the Login page (where to input username and password)Defaults toism.italycsc.com's Maximo login pageExample:maximo = MGC.MaximoAutomation({ 
	"debug": False, 
	"headless": True 
})login(USERNAME, PASSWORD)Performs the login using the given credentialslogout()Performs the logoutgoto_section(SECTION_NAME)Uses theGotobutton to change section. It needs to be the text without the "(MP)" part...close()Closes the browser. Make sure toalwayscall it afterlogout()to avoid running out of available sessions in Maximo after a whilewaitUntilReady()Pauses the script until Maximo has finished loading.For example you can use it after changing section or clicking on an element to wait until Maximo has finished rendering or retrieving the datasetFilters(FILTERS)Sets the filters of a table in the form of a dictionary where thekeyis the filter name (ex. Summary,in red) and the value is the filter value (ex. "Hostname not reachable",in blue)To set multiple filters just add more key/value pairs. Ex:setFilters({ 
	"Summary": "*Test*",
	"Priority": "1", 
	"Global Issue?": "Y" 
})getBrowserInstance()Returns theselenium.webdriverinstance of the browser so you can have more control or implementcustom actions(like clicking on a particular element, inserting text somewhere and more...)goto_tab(TAB_NAME)Clicks on the specified tab when inside a record detail (ex. inside an Incident/Change, ecc...)getAllRecordsFromTable()Returns a dictionary containing all the details of all the records of a list table (ex. when insideChanges open owned by my groups).waitForInputEditable()setNamedInput(TARGETS)Takes a dictionary as argument and searchesinputs labelled by the string given as key; if presen, its value is set to the value of the corresponding pair in the dictionaryTo set the highlighted fields of the image you would have to call the method like this:setNamedInput({ 
	"New Status:": "NEW_STATUS",
	"New Owner Group:": "MY_GROUP",
})To be continued...Known LimitationsBydefaultit usesChromeTo use another browser, or to set custom flags, you can createyour own webdriver instanceand pass it toMaximoAutomationto use it. For example:fromselenium.webdriverimportFirefoxfromselenium.webdriver.firefox.optionsimportOptionsimportmaximo_gui_connectorasMGCopts=Options()opts.set_headless()assertopts.headless# Operating in headless modemy_webdriver_instance=webdriver.Firefox(options=opts)maximo=MGC.MaximoAutomation({"driver":my_webdriver_instance})This method, however, introduces anew problem:The WebdriverMUST bein thePATHwhen using custom WebdriverTo prevent having to download manually the right Webdriver the first time and every time the browser update, you can make use of thewebdriver-managerpackage.What it does is essentially keep a cached version of the Webdriver check every time if the Webdriver version is the same as the installed browser. If not it downloads it.To use it:fromseleniumimportwebdriver# Webdriver Managerfromwebdriver_manager.firefoximportGeckoDriverManagerimportmaximo_gui_connectorasMGC# If not 'installed' it will download an updated version of the drivermy_webdriver_instance=webdriver.Firefox(executable_path=GeckoDriverManager().install())maximo=MGC.MaximoAutomation({"driver":my_webdriver_instance})