Collecting accuracy and availability attributes


Collect the error details related to the accuracy and availability of your application by defining the accuracy errors and availability errors criteria in a script. Accuracy errors are determined based on content validation, title validation, and response data verification.
Availability errors occur when the application does not respond or when the application responds with an error indicating it is unavailable. 


The following video (2:42) illustrates how you collect attributes in BMC PATROL for Synthetic Monitoring.

icon_play.pngWatch this video to learn how to collect accuracy and availability attributes in BMC PATROL for Synthetic Monitoring.

Before you begin
  • Import the STMWebDriver module in your Python script. This module is available in the $PATROL_HOME/stm/bin directory.

For example:
from STMWebDriver import STMWebDriver

  • Get the driver instance from the STMWebDriver module.

For example:
driver = STMWebDriver.Chrome()

Use the following functions in the script to get the accuracy errors based on the title and data verification.

  • For the title verification:
    driver.verify_title("<title to verify>")
  • For the data verification:
    driver.verify_data("<content to verify>")

Call the driver.verify_data() method multiple times to verify multiple data strings. 

Important

Make sure that you call the driver.verify_title() or driver.verify_data() methods before calling the driver.get() method.

In the following script example, we verify the title and data on a webpage.

from selenium import webdriver
from STMWebDriver import STMWebDriver

options = webdriver.ChromeOptions()
options.add_argument("--disable-gpu")
options.add_argument("--headless")
driver = STMWebDriver.Chrome(options=options)
try:
    driver.verify_title('Documentation')
    driver.verify_data('BMC Product Documentation')
    driver.get('https://docs.bmc.com/docs/')

finally:
    driver.close()
    driver.quit()

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*