Skip to content

BrowserWrapperConfiguration Reference

Model for scan configuration

Source code in BrowserWrapper/browserwrapper.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@dataclass
class BrowserWrapperConfiguration:
    """Model for scan configuration"""

    def __init__(self, BrowserType="Chrome", Remote=False, Headless=False, BrowserWidth=1920,
                 BrowserHeight=1080, SeleniumGridHost="", SeleniumGridPort=4444, Options=[], DesiredCapabilities={}):
        """BrowserWrapperConfiguration instances are used to standardize driver configuration when provided while creating a BrowserWrapper instance.

        Keyword Arguments:
            BrowserType {str} -- "Chrome" or "Firefox" (default: {"Chrome"})
            Remote {bool} -- Generates a remote grid browser when enabled, versus a local browser when false (default: {False})
            Headless {bool} -- When set to True, the browser will be headless (default: {False})
            BrowserWidth {int} -- Width to create the browser as (default: {1920})
            BrowserHeight {int} -- Height to create the browser as (default: {1080})
            SeleniumGridHost {str} -- If Remote is True, this is the host of the Selenium Grid Hub (default: {""})
            SeleniumGridPort {int} -- If Remote is True, this is the port of the Selenium Grid Hub (default: {4444})
            Options {list} -- Chrome or Firefox options to enable (default: {[]})
            DesiredCapabilities {dict} -- DesiredCapabilities to provide to the driver (default: {{}})
        """
        self.BrowserType = BrowserType
        self.Remote = Remote
        self.Headless = Headless
        self.BrowserWidth = BrowserWidth
        self.BrowserHeight = BrowserHeight
        self.SeleniumGridHost = SeleniumGridHost
        self.SeleniumGridPort = SeleniumGridPort
        self.Options = Options
        self.DesiredCapabilities = DesiredCapabilities

__init__(BrowserType='Chrome', Remote=False, Headless=False, BrowserWidth=1920, BrowserHeight=1080, SeleniumGridHost='', SeleniumGridPort=4444, Options=[], DesiredCapabilities={})

BrowserWrapperConfiguration instances are used to standardize driver configuration when provided while creating a BrowserWrapper instance.

Other Parameters:

Name Type Description
BrowserType {str} -- "Chrome" or "Firefox" (default

{"Chrome"})

Remote {bool} -- Generates a remote grid browser when enabled, versus a local browser when false (default

{False})

Headless {bool} -- When set to True, the browser will be headless (default

{False})

BrowserWidth {int} -- Width to create the browser as (default

{1920})

BrowserHeight {int} -- Height to create the browser as (default

{1080})

SeleniumGridHost {str} -- If Remote is True, this is the host of the Selenium Grid Hub (default

{""})

SeleniumGridPort {int} -- If Remote is True, this is the port of the Selenium Grid Hub (default

{4444})

Options {list} -- Chrome or Firefox options to enable (default

{[]})

DesiredCapabilities {dict} -- DesiredCapabilities to provide to the driver (default

{{}})

Source code in BrowserWrapper/browserwrapper.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
def __init__(self, BrowserType="Chrome", Remote=False, Headless=False, BrowserWidth=1920,
             BrowserHeight=1080, SeleniumGridHost="", SeleniumGridPort=4444, Options=[], DesiredCapabilities={}):
    """BrowserWrapperConfiguration instances are used to standardize driver configuration when provided while creating a BrowserWrapper instance.

    Keyword Arguments:
        BrowserType {str} -- "Chrome" or "Firefox" (default: {"Chrome"})
        Remote {bool} -- Generates a remote grid browser when enabled, versus a local browser when false (default: {False})
        Headless {bool} -- When set to True, the browser will be headless (default: {False})
        BrowserWidth {int} -- Width to create the browser as (default: {1920})
        BrowserHeight {int} -- Height to create the browser as (default: {1080})
        SeleniumGridHost {str} -- If Remote is True, this is the host of the Selenium Grid Hub (default: {""})
        SeleniumGridPort {int} -- If Remote is True, this is the port of the Selenium Grid Hub (default: {4444})
        Options {list} -- Chrome or Firefox options to enable (default: {[]})
        DesiredCapabilities {dict} -- DesiredCapabilities to provide to the driver (default: {{}})
    """
    self.BrowserType = BrowserType
    self.Remote = Remote
    self.Headless = Headless
    self.BrowserWidth = BrowserWidth
    self.BrowserHeight = BrowserHeight
    self.SeleniumGridHost = SeleniumGridHost
    self.SeleniumGridPort = SeleniumGridPort
    self.Options = Options
    self.DesiredCapabilities = DesiredCapabilities