baangt.base package


baangt.base.ApiHandling module

class baangt.base.ApiHandling.ApiHandling

Bases: object

getURL(url=None, sessionNumber=1)
postURL(url=None, content=None, sessionNumber=1)
static returnTestCaseStatus(status_code)
setHeaders(sessionNumber=1, setHeaderData=None)
setLoginData(userName, password, sessionNumber=1)

baangt.base.BrowserHandling module

baangt.base.CliAndInteractive module


baangt.base.CustGlobalConstants module

baangt.base.ExportResults module

baangt.base.GlobalConstants module

baangt.base.HandleDatabase module

class baangt.base.HandleDatabase.HandleDatabase(linesToRead, globalSettings=None)

Bases: object


We built self.range during init. Now we need to iterate over the range(s) in range, find appropriate record and return that - one at a time


read_excel(fileName, sheetName)
rlp_iterate(data, fileName)
rlp_process(string, fileName)
update_datarecords(dataDict, fileName, sheetName, noCloneXls)
class baangt.base.HandleDatabase.Writer(path)

Bases: object

This class is made to update existing excel file. First it will open the file in python and then we can do multiple writes and once everything is update we can use save method in order to save the updated excel file. Hence, this class is very useful is saving time while updating excel files.

write(row, data, sht)

baangt.base.IBAN module

class baangt.base.IBAN.IBAN(bankLeitZahl='20151', bankLand='AT')

Bases: object


Generates a random IBAN based on bankLand and bankLeitzahl as well as a random account number

@return: gives a String of IBAN

baangt.base.TestRun module

baangt.base.TestRunExcelImporter module

class baangt.base.TestRunExcelImporter.TestRunExcelImporter(FileNameAndPath, testRunUtils: baangt.base.TestRunUtils.TestRunUtils)

Bases: object

The TestrunSettings are in class TestRunUtils and expected to be a deep dict. For details see documentation there.

This class will migrate data from an excel sheet (either simple format with only 1 tab or complex format with all structural elements) into the deep dict.

In case the XLSX is simple format, all missing data is “predicted”/assumed.


If no browser is given in globals file then this method will first look for installed browsers in system. First priority will be given to firefox & then chrome.


baangt Global constants (baangt.base.GlobalConstants) are available everywhere as GC., e.g. the variable “BROWSER” defined in GlobalConstants can be accessed from everywhere within baangt by using “GC.BROWSER”.

The variables can also be used in configuration files (would be very stupid if we need to change a constant and then 100s of Config-Files need adjustment - worst case the testruns behave unexepected). This applies both to XLSX and JSON Config files.

The CGC.-Part is still needs fixing. It shouldn’t appear in Baangt base, but currently still needed.

@param value: potentially convertable value (e.g. GC.BROWSER) @return: potentially converted value (e.g. “Browser”)

baangt.base.TestRunUtils module

class baangt.base.TestRunUtils.TestRunUtils

Bases: object

getSequenceByNumber(sequence, testRunName)
getTestCaseByNumber(sequence, testcaseNumber)
getTestStepByNumber(testCase, testStepNumber)
replaceClasses(testRunName, classes: baangt.base.TestRun.ClassesForObjects.ClassesForObjects)

Apart from what is defined in the TestRunDefintion (XLSX or “guessed” by TestRunExcelImporter) the user may give new class names in the globals file.

We shall replace all corresponding appearances with those new class names

Returns:No return parameter. Changes are kept internally

Will go through all testcase-Settings and replace values with values from global settings, if matched

setCompleteTestRunAttributes(testRunName: str, testRunAttributes: dict)

baangt.base.Timing module

baangt.base.Utils module

class baangt.base.Utils.utils

Bases: object

static anything2Boolean(valueIn)
static datetime_return()
static dynamicImportOfClasses(modulePath=None, className=None, fullQualifiedImportName=None)

Will import a class from a module and return the class reference

@param fullQualifiedImportName: Full name of Module and Class. Alternatively: @param modulePath: Path to module and: @param className: Name of the class inside the module @return: The class instance. If no class instance can be found the TestRun aborts hard with sys.exit

static extractFileNameFromFullPath(fileAndPathName)
static findFileAndPathFromPath(fileNameAndPath, basePath=None)

Tries different approaches to locate a file lBasePath = the Path where the script is run

@param fileNameAndPath: Filename and potentially relative path @param basePath (optional): Optional basePath to look at @return:

static listToString(completeList)

Returns a concatenated string from a list-object :param completeList: any List :return: String

static openJson(fileNameAndPath)
static replaceAllGlobalConstantsInDict(lDict: dict)
static replaceFieldValueWithValueOfConstant(value)

If a String reference to global Constant (e.g. GC.BROWSER_FF) is given, this function will replace it with the actual value (e.g. FIREFOX)

static sanitizeFileName(value)
static setLocatorFromLocatorType(lLocatorType, lLocator)

@param lLocatorType: XPATH, CSS, ID, etc. @param lLocator: Value of the locator @return:

static setLogLevel(level)
static traceback(exception_in)

Module contents