package: qacode.core.bots

Class: BotBase

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
close()[source]

Close curr_driver browser

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
navigation = None
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

Class: NavBase (used at bot.navigation as property)

Created on 04 march 2017

@author: ntz

class qacode.core.bots.modules.nav_base.NavBase(driver, log, driver_wait=None, driver_actions=None, driver_touch=None)[source]

Bases: object

Main navigation methods to use on selenium scripts

Adds a cookie to your current session.

Args:
cookie_dict: A dictionary object, with required
keys - “name” and “value” optional keys - “path”, “domain”, “secure”, “expiry”
Usage:
driver.add_cookie({
“name” : “foo”, “value” : “bar”})
driver.add_cookie({
‘name’ : ‘foo’, ‘value’ : ‘bar’, ‘path’ : ‘/’, ‘secure’:True, ‘domain’: None})

Deletes a single cookie with the given name

delete_cookies()[source]

Delete all cookies in the scope of the session

driver = None
driver_actions = None
driver_touch = None
driver_wait = None
ele_attribute(element, attr_name)[source]

Returns tuple with (attr, value) if founds This method will first try to return the value of a property with the given name. If a property with that name doesn’t exist, it returns the value of the attribute with the same name. If there’s no attribute with that name, None is returned.

ele_clear(element)[source]

Clear element text

ele_click(element=None, selector=None, locator='css selector')[source]
Perform click webelement with locator param or search it by default
CSS_SELECTOR value if element it’s none but selector it’s not default value
Keyword Arguments:
element {WebElement} – selenium object, instance of WebElement
(default: {None})
selector {str} – selector to search and element to click
(default: {None})
locator {By} – locator selenium strategy
(default: {By.CSS_SELECTOR})
Raises:
CoreException – Bad params combination, need element
or selector to search element
Returns:
WebElement – returns element clicked (to allow chaining)
ele_css(element, prop_name)[source]

Allows to obtain CSS value based on CSS property name

Arguments:
element {WebElement} – WebElement to modify CSS property prop_name {str} – CSS property name
Returns:
str – Value of CSS property searched
ele_input_value(element)[source]

Return value of value attribute, usefull for inputs

ele_is_displayed(element)[source]

Whether the element is visible to a user

Webdriver spec to determine if element it’s displayed:
https://w3c.github.io/webdriver/webdriver-spec.html#widl-WebElement-isDisplayed-boolean
Arguments:
element {WebElement} – selenium web element
Returns:
bool – Value based on selenium SPEC to determine if an element
is enabled
ele_is_enabled(element)[source]

Returns whether the element is enabled

Arguments:
element {WebElement} – selenium web element
Returns:
bool – Value based on selenium SPEC to determine if an element
is enabled
ele_is_selected(element)[source]

Returns whether the element is selected

Arguments:
element {WebElement} – selenium web element
Returns:
bool – Value based on selenium SPEC to determine if an element
is enabled
ele_tag(element)[source]

Returns element.tag_name value

ele_text(element, on_screen=True)[source]
Get element content text.
If the isDisplayed() method can sometimes trip over when the element is not really hidden but outside the viewport get_text() returns an empty string for such an element.
Keyword Arguments:
on_screen {bool} – allow to obtain text if element
it not displayed to this element before read text (default: {True})
Returns:
str – Return element content text (innerText property)
ele_wait_invisible(selector, locator='css selector', timeout=0)[source]

Wait for invisible element (display:none), returns element

ele_wait_text(selector, text, locator='css selector', timeout=0)[source]

Wait if the given text is present in the specified element

ele_wait_value(selector, value, locator='css selector', timeout=0)[source]

Wait if the given value is present in the specified element

ele_wait_visible(element, timeout=0)[source]

Wait for visible condition element, returns self

ele_write(element, text=None)[source]

Over element perform send_keys , if not sended text, then will write empty over element :param element: WebElement :return: None

execute_js(script, *args)[source]

Execute arbitrary Javascript code

Arguments:
script {str} – JS code to be executed on WebDriver *args {[type]} – More arguments ( like element selector )
Returns:
str – JS script returns
find_element(selector, locator='css selector')[source]
Just divided execution ways for search web element
throught selenium
Arguments:
selector {str} – string selector used to locate one
element or first obtained
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
Raises:

CoreException – If locator is None CoreException – Element selector+locator strategy raises

selenium NoSuchElementException
Returns:
WebElement – selenium representation for a web element
find_element_child(element, child_selector, locator='css selector')[source]

TODO: doc method

find_element_children(element, child_selector, locator='css selector')[source]

TODO: doc method

find_element_wait(selector, locator='css selector', driver_wait=None)[source]
Search element using WebDriverWait class
and ElementConditions presence_of_element_located
Arguments:
selector {str} – string selector used to locate one
element or first obtained
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
driver_wait {WebDriverWait} – driver that supports
ExpectedConditions methods (default: {None})
Raises:
CoreException – if NavBase instanced
without driver_wait
Returns:
WebElement – element through selenium
WebDriverWait class
find_elements(selector, locator='css selector')[source]
Just divided execution ways for search web elements
throught selenium
Arguments:
selector {str} – string selector used to locate
one or more elements
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
Raises:

CoreException – If locator is None CoreException – Element selector+locator strategy raises

selenium NoSuchElementException
Returns:
list(WebElement) – selenium representation for a
list of web elements
find_elements_child()[source]

TODO: doc method

find_elements_children()[source]

TODO: doc method

find_elements_wait(selector, locator='css selector', driver_wait=None)[source]
Search elements using WebDriverWait class
and ElementConditions presence_of_all_elements_located
Arguments:
selector {str} – string selector used to locate
multiple elements
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
driver_wait {WebDriverWait} – driver that supports
ExpectedConditions methods (default: {None})
Raises:
CoreException – if NavBase instanced
without driver_wait
Returns:
WebElement – element through selenium
WebDriverWait class
forward()[source]

Go forward using browser functionality

get_capabilities()[source]

Retrieve current capabilities applied to selenium driver

get_cookies()[source]

Returns a set of dictionaries, corresponding to cookies visible in the current session.

get_current_url()[source]

Return current url from opened bot

Raises:
CoreException – if can’t obtains url with this
selenium driver
Returns:
str – string representation of current driver url
get_driver_wait(driver_wait=None)[source]

TODO: doc method

get_log(log_name='browser', raises=False)[source]
Get selenium log by name, this depends of
driver mode and browser what it’s using each time
Keyword Arguments:
log_name {str} – get log type lanes (default: {‘browser’})
Raises:
CoreException – if log_name value not in list
of valid values : browser, driver, client, server
Returns:
list() – list of messages typed on a log_name
get_maximize_window()[source]

Maximize browser window

get_screenshot_as_base64()[source]

Gets the screenshot of the current window as a base64 encoded string which is useful in embedded images in HTML

get_screenshot_as_file(file_name)[source]
Gets the screenshot of the current window. Returns False
if there is any IOError, else returns True. Use full paths in your filename.
Arguments:
file_name {str} – name of file path where
want to save screenshot
Returns:
list(byte) – file binary object of screenshot bytes
get_screenshot_as_png()[source]
Gets the screenshot of the current window as a
binary data.
Returns:
File – file binary object of screenshot with PNG format
get_screenshot_save(file_name)[source]
Gets the screenshot of the current window. Returns False
if there is any IOError, else returns True. Use full paths in your filename.
Arguments:
file_name {str} – name of file path where
want to save screenshot
Returns:
list(byte) – file binary object of screenshot bytes
get_title()[source]

Obtains the title of the current page and return it

Returns:
str – title of current page opened
get_url(url, wait_for_load=0)[source]

Do get_url including implicit wait for page load

get_window_handle()[source]

Get window object to handle with selenium on scripts

is_url(url, ignore_raises=True)[source]

Check if url it’s the same what selenium current and visible url

Arguments:
url {str} – string value used to verify url
Keyword Arguments:
ignore_raises {bool} – allows to ignore errors
when executes if raises errors (default: {True})
Raises:
exceptions – [description] CoreException – [description]
Returns:
bool – if current driver url match with param url,
then returns True, False if not
js_set_timeout(timeout=60)[source]
Set the amount of time that the script should wait during an
execute_async_script call before throwing an error.
Keyword Arguments:
timeout {int} – seconds to raise script
wait (default: {60})
log = None
reload()[source]

Go reload page using browser functionality

set_css_rule(css_selector, css_prop, css_value, css_important=False, index=0)[source]

Set new value for given CSS property name

Arguments:
css_selector {str} – CSS selector to apply rule css_prop {str} – CSS property to be applied to rule css_value {str} – CSS property value to be applied to rule
Keyword Arguments:
css_important {bool} – Allow to include ‘!important’
to rule (default: {False})
index {int} – Position to insert new CSS rule
on first stylesheet (default: {0})
Returns:
str – JS script returns
set_web_element(new_attr_id)[source]

Create web element using selenium adding to DOM

Arguments:
new_attr_id {str} – html attribute ID for
new web element
set_window_size(pos_x=800, pos_y=600)[source]
Sets the width and height of the current
window. (window.resizeTo)
Keyword Arguments:
pos_x {int} – width of new window size (default: {800}) pos_y {int} – height of new window size (default: {600})
class qacode.core.bots.modules.nav_base.NavBase(driver, log, driver_wait=None, driver_actions=None, driver_touch=None)[source]

Main navigation methods to use on selenium scripts

add_cookie(cookie_dict)[source]

Adds a cookie to your current session.

Args:
cookie_dict: A dictionary object, with required
keys - “name” and “value” optional keys - “path”, “domain”, “secure”, “expiry”
Usage:
driver.add_cookie({
“name” : “foo”, “value” : “bar”})
driver.add_cookie({
‘name’ : ‘foo’, ‘value’ : ‘bar’, ‘path’ : ‘/’, ‘secure’:True, ‘domain’: None})
delete_cookie_by_key(key_name)[source]

Deletes a single cookie with the given name

delete_cookies()[source]

Delete all cookies in the scope of the session

ele_attribute(element, attr_name)[source]

Returns tuple with (attr, value) if founds This method will first try to return the value of a property with the given name. If a property with that name doesn’t exist, it returns the value of the attribute with the same name. If there’s no attribute with that name, None is returned.

ele_clear(element)[source]

Clear element text

ele_click(element=None, selector=None, locator='css selector')[source]
Perform click webelement with locator param or search it by default
CSS_SELECTOR value if element it’s none but selector it’s not default value
Keyword Arguments:
element {WebElement} – selenium object, instance of WebElement
(default: {None})
selector {str} – selector to search and element to click
(default: {None})
locator {By} – locator selenium strategy
(default: {By.CSS_SELECTOR})
Raises:
CoreException – Bad params combination, need element
or selector to search element
Returns:
WebElement – returns element clicked (to allow chaining)
ele_css(element, prop_name)[source]

Allows to obtain CSS value based on CSS property name

Arguments:
element {WebElement} – WebElement to modify CSS property prop_name {str} – CSS property name
Returns:
str – Value of CSS property searched
ele_input_value(element)[source]

Return value of value attribute, usefull for inputs

ele_is_displayed(element)[source]

Whether the element is visible to a user

Webdriver spec to determine if element it’s displayed:
https://w3c.github.io/webdriver/webdriver-spec.html#widl-WebElement-isDisplayed-boolean
Arguments:
element {WebElement} – selenium web element
Returns:
bool – Value based on selenium SPEC to determine if an element
is enabled
ele_is_enabled(element)[source]

Returns whether the element is enabled

Arguments:
element {WebElement} – selenium web element
Returns:
bool – Value based on selenium SPEC to determine if an element
is enabled
ele_is_selected(element)[source]

Returns whether the element is selected

Arguments:
element {WebElement} – selenium web element
Returns:
bool – Value based on selenium SPEC to determine if an element
is enabled
ele_tag(element)[source]

Returns element.tag_name value

ele_text(element, on_screen=True)[source]
Get element content text.
If the isDisplayed() method can sometimes trip over when the element is not really hidden but outside the viewport get_text() returns an empty string for such an element.
Keyword Arguments:
on_screen {bool} – allow to obtain text if element
it not displayed to this element before read text (default: {True})
Returns:
str – Return element content text (innerText property)
ele_wait_invisible(selector, locator='css selector', timeout=0)[source]

Wait for invisible element (display:none), returns element

ele_wait_text(selector, text, locator='css selector', timeout=0)[source]

Wait if the given text is present in the specified element

ele_wait_value(selector, value, locator='css selector', timeout=0)[source]

Wait if the given value is present in the specified element

ele_wait_visible(element, timeout=0)[source]

Wait for visible condition element, returns self

ele_write(element, text=None)[source]

Over element perform send_keys , if not sended text, then will write empty over element :param element: WebElement :return: None

execute_js(script, *args)[source]

Execute arbitrary Javascript code

Arguments:
script {str} – JS code to be executed on WebDriver *args {[type]} – More arguments ( like element selector )
Returns:
str – JS script returns
find_element(selector, locator='css selector')[source]
Just divided execution ways for search web element
throught selenium
Arguments:
selector {str} – string selector used to locate one
element or first obtained
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
Raises:

CoreException – If locator is None CoreException – Element selector+locator strategy raises

selenium NoSuchElementException
Returns:
WebElement – selenium representation for a web element
find_element_child(element, child_selector, locator='css selector')[source]

TODO: doc method

find_element_children(element, child_selector, locator='css selector')[source]

TODO: doc method

find_element_wait(selector, locator='css selector', driver_wait=None)[source]
Search element using WebDriverWait class
and ElementConditions presence_of_element_located
Arguments:
selector {str} – string selector used to locate one
element or first obtained
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
driver_wait {WebDriverWait} – driver that supports
ExpectedConditions methods (default: {None})
Raises:
CoreException – if NavBase instanced
without driver_wait
Returns:
WebElement – element through selenium
WebDriverWait class
find_elements(selector, locator='css selector')[source]
Just divided execution ways for search web elements
throught selenium
Arguments:
selector {str} – string selector used to locate
one or more elements
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
Raises:

CoreException – If locator is None CoreException – Element selector+locator strategy raises

selenium NoSuchElementException
Returns:
list(WebElement) – selenium representation for a
list of web elements
find_elements_child()[source]

TODO: doc method

find_elements_children()[source]

TODO: doc method

find_elements_wait(selector, locator='css selector', driver_wait=None)[source]
Search elements using WebDriverWait class
and ElementConditions presence_of_all_elements_located
Arguments:
selector {str} – string selector used to locate
multiple elements
Keyword Arguments:
locator {By} – locator strategy used to find
WebElement selector (default: {By.CSS_SELECTOR})
driver_wait {WebDriverWait} – driver that supports
ExpectedConditions methods (default: {None})
Raises:
CoreException – if NavBase instanced
without driver_wait
Returns:
WebElement – element through selenium
WebDriverWait class
forward()[source]

Go forward using browser functionality

get_capabilities()[source]

Retrieve current capabilities applied to selenium driver

get_cookies()[source]

Returns a set of dictionaries, corresponding to cookies visible in the current session.

get_current_url()[source]

Return current url from opened bot

Raises:
CoreException – if can’t obtains url with this
selenium driver
Returns:
str – string representation of current driver url
get_driver_wait(driver_wait=None)[source]

TODO: doc method

get_log(log_name='browser', raises=False)[source]
Get selenium log by name, this depends of
driver mode and browser what it’s using each time
Keyword Arguments:
log_name {str} – get log type lanes (default: {‘browser’})
Raises:
CoreException – if log_name value not in list
of valid values : browser, driver, client, server
Returns:
list() – list of messages typed on a log_name
get_maximize_window()[source]

Maximize browser window

get_screenshot_as_base64()[source]

Gets the screenshot of the current window as a base64 encoded string which is useful in embedded images in HTML

get_screenshot_as_file(file_name)[source]
Gets the screenshot of the current window. Returns False
if there is any IOError, else returns True. Use full paths in your filename.
Arguments:
file_name {str} – name of file path where
want to save screenshot
Returns:
list(byte) – file binary object of screenshot bytes
get_screenshot_as_png()[source]
Gets the screenshot of the current window as a
binary data.
Returns:
File – file binary object of screenshot with PNG format
get_screenshot_save(file_name)[source]
Gets the screenshot of the current window. Returns False
if there is any IOError, else returns True. Use full paths in your filename.
Arguments:
file_name {str} – name of file path where
want to save screenshot
Returns:
list(byte) – file binary object of screenshot bytes
get_title()[source]

Obtains the title of the current page and return it

Returns:
str – title of current page opened
get_url(url, wait_for_load=0)[source]

Do get_url including implicit wait for page load

get_window_handle()[source]

Get window object to handle with selenium on scripts

is_url(url, ignore_raises=True)[source]

Check if url it’s the same what selenium current and visible url

Arguments:
url {str} – string value used to verify url
Keyword Arguments:
ignore_raises {bool} – allows to ignore errors
when executes if raises errors (default: {True})
Raises:
exceptions – [description] CoreException – [description]
Returns:
bool – if current driver url match with param url,
then returns True, False if not
js_set_timeout(timeout=60)[source]
Set the amount of time that the script should wait during an
execute_async_script call before throwing an error.
Keyword Arguments:
timeout {int} – seconds to raise script
wait (default: {60})
reload()[source]

Go reload page using browser functionality

set_css_rule(css_selector, css_prop, css_value, css_important=False, index=0)[source]

Set new value for given CSS property name

Arguments:
css_selector {str} – CSS selector to apply rule css_prop {str} – CSS property to be applied to rule css_value {str} – CSS property value to be applied to rule
Keyword Arguments:
css_important {bool} – Allow to include ‘!important’
to rule (default: {False})
index {int} – Position to insert new CSS rule
on first stylesheet (default: {0})
Returns:
str – JS script returns
set_web_element(new_attr_id)[source]

Create web element using selenium adding to DOM

Arguments:
new_attr_id {str} – html attribute ID for
new web element
set_window_size(pos_x=800, pos_y=600)[source]
Sets the width and height of the current
window. (window.resizeTo)
Keyword Arguments:
pos_x {int} – width of new window size (default: {800}) pos_y {int} – height of new window size (default: {600})