Polarion client

The polarion connects to the WSDL services of the Polarion service. These are listed at <polarion_url>/ws/services. It is important that the url it the url where you normally login. So it should include /polarion in most cases.

Initialization

The class can be instantiated like this:

pol = polarion.Polarion('http://example.com/polarion', 'user', 'password')
print(pol) # Polarion client for http://example.com/polarion/ws/services with user <user>

Token

If you are using a token to autenticates:

pol = polarion.Polarion('http://example.com/polarion', 'user', password=None, token='token')
print(pol) # Polarion client for http://example.com/polarion/ws/services with user <user>

Proxy

You can specify a proxy by providing an domain or ip with a port number.

pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', proxy='ip:port')

Self signed certificates

If your polarion instance has a self signed certificate or an expired certificate, a https connections will be rejected. You can skip certificate verification by passed an additional argument.

pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', verify_certificate=False)

SVN repository location

The SVN repository access can be different from the standard (http://example.com/repo). If this is the case, pass the new location using svn_repo_url. This is used while download attachment form test runs or test records.

pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', svn_repo_url='http://example.com/repo_location')

Retry Mechanism

A custom retry strategy can be set by using the request_session parameter of the polarion constructor. See example below.

Slow performance

Sometimes a bug in the soap client can cause poor performance. Disabling session validation can help in this case.

Services

Typically you would not use any service directly, but it is an option. Using it this way would ensure the session is still valid.

Warning

The refreshing of the session is still an open issue and not yet implemented. Using this module for prolonged time will likely lead to an ended session.

pol = polarion.Polarion('http://example.com/polarion', 'user', 'password')
s = pol.getService('Tracker')
print(s) # <zeep.proxy.ServiceProxy object at 0x0000025C01BF3A48>

Polarion class

class polarion.polarion.Polarion(polarion_url, user, password=None, token=None, static_service_list=False, verify_certificate=True, svn_repo_url=None, proxy=None, request_session=None, cache=False)

Create a Polarion client which communicates to the Polarion server.

Parameters:
  • polarion_url – The base URL for the polarion instance. For example http://example/com/polarion

  • user – The user name to login

  • password – The password for that user

  • token – The token to log with token. In this case, no need to set password

  • static_service_list – Set to True when this class may not use a request to get the services list

  • verify_certificate – Set to True/False to activate certification validation for TLS connection or provide string with link to certification chain (PEM & x264 encoded)

  • svn_repo_url – Set to the correct url when the SVN repo is not accessible via <host>/repo. For example http://example/repo_extern

  • proxy – Set to a proxy address to use a proxy, use the format: proxy=’ip:port’

property PdfProperties

Get PDF properties object but only if it exist. If is was not able to get it from Polarion, fail with a exception only when using this feature @return: PdfProperties

getProject(project_id)

Get a Polarion project

Parameters:

project_id – The ID of the project.

Returns:

The request project

Return type:

Project

getService(name: str)

Get a WSDL service client. The name can be ‘Tracker’ or ‘Session’

getTypeFromService(name: str, type_name)
hasService(name: str)

Checks if a WSDL service is available