Batch Library

API introduction

We are currently providing the following Python APIs to the users, which help them implement their own ad-hoc batch testing. More APIs are to be added. You can send a request to wpt-eng@google.com with the detailed description if you want to add a new API. We will evaluate your request and get back to you.

API description

Create a batch test

def ImportUrls(url_filename):
  """Load the URLS in the file into memory.

  Args:
    url_filename: the file name of the list of interested URLs

  Returns:
    The list of URLS
  """

Submit a batch test

def SubmitBatch(url_list, test_params, server_url):
  """Submit the tests to WebPageTest server.

  Args:
    url_list: the list of interested URLs
    test_params: the user-configured test parameters
    server_url: the URL of the WebPageTest server

  Returns:
    A dictionary which maps a WPT test id to its URL if submission
    is successful.
  """

Check the test status of a batch test

def CheckBatchStatus(test_ids, server_url):
  """Check the status of tests.

  Args:
    test_ids: the list of interested test ids
    server_url: the URL of the WebPageTest server
 
  Returns:
    A dictionary where key is the test id and content is its status.
  """

Obtain the test result of a batch test

def GetXMLResult(test_ids, server_url):
  """Obtain the test result in XML format.

  Args:
    test_ids: the list of interested test ids
    server_url: the URL of WebPageTest server

  Returns:
    A dictionary where the key is test id and the value is a DOM object of the
    test result.
  """

Comments