TODO
- class
qacode.core.bots.bot_base.
BotBase
(**kwargs)[source]¶Bases:
object
Class Base for handle selenium functionality throught this wrapper
curr_caps – Capabilities class
curr_driver – WebDriver class
curr_driver_path – WebDriver browser executable path
curr_driver_wait – Wait for expected conditions
curr_driver_actions – Performs actions on elements
curr_driver_touch – Perform touch actions on elements
navigation – Bot methods to brigde selenium functions
bot_config – Bot configuration object
- logger_manager – logger manager class loaded from
- LoggerManager object
log – log class to write messages
BROWSERS_WITHOUT_OPTIONS
= ('iexplorer', 'edge')¶
IS_64BITS
= True¶
IS_WIN
= True¶
curr_caps
= None¶
curr_driver
= None¶
curr_driver_actions
= None¶
curr_driver_path
= None¶
curr_driver_touch
= None¶
curr_driver_wait
= None¶
curr_options
= None¶
driver_name_filter
(driver_name=None)[source]¶Filter names of driver to search selected on config list
- Keyword Arguments:
- driver_name {str} – driver_name_format is
- {driver_name}{arch}{os} (default: {None})
- Raises:
- CoreException – driver_name param is None CoreException – driver_name not in
- Returns:
- str – name of driver
- (example: chromedriver_32.exe)
get_capabilities
(browser_name='chrome')[source]¶Instance DesiredCapabilities class from selenium and return it
- Keyword Arguments:
- browser_name {str} – name of a valid browser name for selenium
- (default: {‘chrome’})
- Raises:
- CoreException – if name of browser isn’t supported
- Returns:
- [DesiredCapabilities] – DesiredCapabilities inherit
- class instanced for one browser
get_driver_chrome
(driver_path=None, capabilities=None, options=None)[source]¶Open WebDriver selenium based on Chrome browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
options {Options} – Options for browser (default: {None})
- Returns:
- [WebDriver.Chrome] – WebDriver opened and ready to be used
get_driver_edge
(driver_path=None, capabilities=None)[source]¶Open WebDriver selenium based on Edge browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
options {Options} – Options for browser (default: {None})
- Returns:
- [WebDriver.Edge] – WebDriver opened and ready to be used
get_driver_firefox
(driver_path=None, capabilities=None, options=None)[source]¶Open WebDriver selenium based on Firefox browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
options {Options} – Options for browser (default: {None})
- Returns:
- [WebDriver.Firefox] – WebDriver opened and ready to be used
get_driver_iexplorer
(driver_path=None, capabilities=None)[source]¶Open WebDriver selenium based on InternetExplorer browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
- Returns:
- [WebDriver.Ie] – WebDriver opened and ready to be used
get_options
(browser_name='chrome', headless_enabled=False)[source]¶Instance Options class from selenium and return it
- Keyword Arguments:
- browser_name {str} – name of a valid browser name for selenium
- (default: {‘chrome’})
- headless_enabled {bool} – allow to configure –headless param
- (default: {False})
- Raises:
- CoreException – if name of browser isn’t supported
- Returns:
- [Options] – Options inherit
- class instanced for one browser
log
= None¶
logger_manager
= None¶
mode_local
(browser_name='chrome')[source]¶Open new brower on local mode
- Raises:
- CoreException – driver_name on config JSON
- file is not valid value
mode_remote
(browser_name='chrome')[source]¶Open new brower on remote mode
- Raises:
- CoreException – browser name is not in valid values list
settings
= None¶
- class
qacode.core.bots.bot_base.
BotBase
(**kwargs)[source]Class Base for handle selenium functionality throught this wrapper
curr_caps – Capabilities class
curr_driver – WebDriver class
curr_driver_path – WebDriver browser executable path
curr_driver_wait – Wait for expected conditions
curr_driver_actions – Performs actions on elements
curr_driver_touch – Perform touch actions on elements
navigation – Bot methods to brigde selenium functions
bot_config – Bot configuration object
- logger_manager – logger manager class loaded from
- LoggerManager object
log – log class to write messages
close
()[source]Close curr_driver browser
driver_name_filter
(driver_name=None)[source]Filter names of driver to search selected on config list
- Keyword Arguments:
- driver_name {str} – driver_name_format is
- {driver_name}{arch}{os} (default: {None})
- Raises:
- CoreException – driver_name param is None CoreException – driver_name not in
- Returns:
- str – name of driver
- (example: chromedriver_32.exe)
get_capabilities
(browser_name='chrome')[source]Instance DesiredCapabilities class from selenium and return it
- Keyword Arguments:
- browser_name {str} – name of a valid browser name for selenium
- (default: {‘chrome’})
- Raises:
- CoreException – if name of browser isn’t supported
- Returns:
- [DesiredCapabilities] – DesiredCapabilities inherit
- class instanced for one browser
get_driver_chrome
(driver_path=None, capabilities=None, options=None)[source]Open WebDriver selenium based on Chrome browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
options {Options} – Options for browser (default: {None})
- Returns:
- [WebDriver.Chrome] – WebDriver opened and ready to be used
get_driver_edge
(driver_path=None, capabilities=None)[source]Open WebDriver selenium based on Edge browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
options {Options} – Options for browser (default: {None})
- Returns:
- [WebDriver.Edge] – WebDriver opened and ready to be used
get_driver_firefox
(driver_path=None, capabilities=None, options=None)[source]Open WebDriver selenium based on Firefox browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
options {Options} – Options for browser (default: {None})
- Returns:
- [WebDriver.Firefox] – WebDriver opened and ready to be used
get_driver_iexplorer
(driver_path=None, capabilities=None)[source]Open WebDriver selenium based on InternetExplorer browser
- Keyword Arguments:
- driver_path {str} – Path for driver binary path
- (default: {None})
- capabilities {DesiredCapabilities} – Capabilities for browser
- (default: {None})
- Returns:
- [WebDriver.Ie] – WebDriver opened and ready to be used
get_options
(browser_name='chrome', headless_enabled=False)[source]Instance Options class from selenium and return it
- Keyword Arguments:
- browser_name {str} – name of a valid browser name for selenium
- (default: {‘chrome’})
- headless_enabled {bool} – allow to configure –headless param
- (default: {False})
- Raises:
- CoreException – if name of browser isn’t supported
- Returns:
- [Options] – Options inherit
- class instanced for one browser
mode_local
(browser_name='chrome')[source]Open new brower on local mode
- Raises:
- CoreException – driver_name on config JSON
- file is not valid value
mode_remote
(browser_name='chrome')[source]Open new brower on remote mode
- Raises:
- CoreException – browser name is not in valid values list