Small Library that makes it easier to create scripts to automate IBM Maximo's frontend
Project description
Maximo GUI Connector for Python
A small package that uses Selenium to automate the most basic operations you could do on IBM Maximo Asset Management
Installation
- Install the package by typing
pip install maximo-gui-connector
- Download the chromedriver (see this note) matching your browser version and put it into PATH
You can import
the package into your script and use it like this:
import maximo_gui_connector as MGC
YOUR_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()
except Exception as e:
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()
except NameError as e:
pass
(In)complete Reference
This section is still work in progress, so some properties/methods could miss.
Name | Description | ||||||
---|---|---|---|---|---|---|---|
MaximoAutomation(CONFIG) |
Instantiates the Maximo object. Takes a dictionary as an argument. Possible configuration:
|
||||||
login(USERNAME, PASSWORD) |
Performs the login using the given credentials | ||||||
logout() |
Performs the logout | ||||||
goto_section(SECTION_NAME) |
Uses the Goto button to change section. It needs to be the text without the "(MP)" part...
|
||||||
close() |
Closes the browser. Make sure to always call it after logout() to avoid running out of available sessions in Maximo after a while |
||||||
waitUntilReady() |
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 data |
||||||
setFilters(FILTERS) |
Sets the filters of a table in the form of a dictionary where the key is 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:
|
||||||
getBrowserInstance() |
Returns the selenium.webdriver instance of the browser so you can have more control or implement custom 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 inside Changes open owned by my groups ).
|
||||||
waitForInputEditable() |
|||||||
setNamedInput(TARGETS) |
Takes a dictionary as argument and searches input s labelled by the string given as key; if presen, its value is set to the value of the corresponding pair in the dictionary
To set the highlighted fields of the image you would have to call the method like this:
|
||||||
To be continued... |
Other
Known Limitations
- Works only with Chrome (for now)
- The Webdriver must be in the PATH (cannot pass another path)
IMPORTANT
As of now (v. 0.1.1) this package only allows to use the Chromedriver (which MUST be installed). The possibility to change the browser is in roadmap.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
maximo-gui-connector-0.6.2.tar.gz
(19.7 kB
view hashes)
Built Distribution
Close
Hashes for maximo-gui-connector-0.6.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c340a68ee37a220938c14adf631612ec37922c3d617c802c7a96615adeda67c |
|
MD5 | 1ae9b67e9131fd544b360eb1b7f9e073 |
|
BLAKE2b-256 | 87754637f8d588e55f3539d5477d41c0fdc52dcc756ee72a6e913d05f6f85b68 |
Close
Hashes for maximo_gui_connector-0.6.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dc3442b2c503294376f8adbd6d909ea3bcd792b9df192d3ca2c98a350081acf |
|
MD5 | 5025db20cc6b7d2b98c440372ed74a19 |
|
BLAKE2b-256 | 0fbbf2870dbd9b548946e1a94b23a3cb99301bf14597019dbbd7c2a414589b30 |