oct.core package

oct.core.exceptions module

exception oct.core.exceptions.FormNotFoundException

Bases: exceptions.Exception

Raised in case of FormNotFound with browser

exception oct.core.exceptions.LinkNotFound

Bases: exceptions.Exception

Raised in case of link not found in current html document

exception oct.core.exceptions.NoFormWaiting

Bases: exceptions.Exception

Raised in case of action required form if no form selected

exception oct.core.exceptions.NoUrlOpen

Bases: exceptions.Exception

Raised in case of no url open but requested inside browser class

exception oct.core.exceptions.OctConfigurationError

Bases: exceptions.Exception

Provide an oct configuration error

exception oct.core.exceptions.OctGenericException

Bases: exceptions.Exception

Provide generic exception for reports

oct.core.generic module

class oct.core.generic.GenericTransaction(pathtoini, **kwargs)

Bases: object

Base class for Transaction, this class provides tools for simpler test writing

Parameters:
  • handle_robots (bool) – set if robots are handle or not
  • pathtoini (str) – the path to the ini file
  • timeout (int) – the timeout in second for static files requests
static csv_to_list(csv_file)

Take a csv file as parameter and read it. Return a list containing all lines

Parameters:csv_file (str) – the csv file to read
Returns:A list containing the lines
Return type:list
static get_random_csv(csv_list)

Simply return a random element from csv_list param

Parameters:csv_list – a list
Returns:random element from the csv_list
run()

Run method will be call by multi-mechanize run function You must implement it

tear_down()

This method will be executed at the end of the run method, usefull if you need to close or clean some resources

oct.core.browser module