{"id":48578308,"url":"https://github.com/loudpumpkins/selenium2","last_synced_at":"2026-04-08T16:04:27.947Z","repository":{"id":179982895,"uuid":"192628504","full_name":"loudpumpkins/selenium2","owner":"loudpumpkins","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-02T21:46:21.000Z","size":205,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T08:35:57.654Z","etag":null,"topics":["automation","selenium"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loudpumpkins.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-19T00:09:14.000Z","updated_at":"2024-08-26T16:27:16.000Z","dependencies_parsed_at":"2025-01-07T08:31:12.222Z","dependency_job_id":null,"html_url":"https://github.com/loudpumpkins/selenium2","commit_stats":null,"previous_names":["loudpumpkins/selenium2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/loudpumpkins/selenium2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loudpumpkins%2Fselenium2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loudpumpkins%2Fselenium2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loudpumpkins%2Fselenium2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loudpumpkins%2Fselenium2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loudpumpkins","download_url":"https://codeload.github.com/loudpumpkins/selenium2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loudpumpkins%2Fselenium2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","selenium"],"created_at":"2026-04-08T16:04:27.871Z","updated_at":"2026-04-08T16:04:27.936Z","avatar_url":"https://github.com/loudpumpkins.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Selenium 2\n============\n\nExtends the python's selenium library by providing easy-to-use methods at the\ncost of customizability. Provides site-specific methods such as login/logout\nfor quick browser automation.\n\nUsage\n------------\n\nInstantiate a simple chrome browser\n\n.. code-block:: python\n\n    chrome = Browser('chrome')\n    chrome.goto('github.com')\n\nInstantiate a firefox browser to run through a proxy\n\n.. code-block:: python\n\n    firefox = Browser('firefox', ip='192.0.0.1:12345')\n\n`NOTE: browser specific drivers need to be present and their path needs to be\nappended in the system's PATH variable.`\nDOWNLOAD LINK: https://www.seleniumhq.org/download/\n\nAvailable Methods\n-----------------\n\nA base instance of ``Browser`` will have all the following methods. Note that you\ncan still access the underlying selenium driver for more fine grained control\nthrough ``Browser.driver``.\n\n.. code-block:: python\n\n    def assert_proxy_is(self, ip:str) -\u003e NoReturn: ...\n    def set_implicit_wait(self, time_to_wait: int) -\u003e NoReturn: ...\n    def unset_implicit_wait(self) -\u003e NoReturn: ...\n\n    \"\"\" from browser.pu \"\"\"\n    def __init__(self, browser: str = 'ff' , desired_capabilities: dict = None,\n            profile: object = None, options: object = None) -\u003e NoReturn: ...\n    # site-specific methods (must 'set_site_behaviour' first)\n    def set_site_behaviour(self, Type[SiteBehaviour]) -\u003e NoReturn: ...\n    def create_account(self, details: dict, cookies: str = None) -\u003e bool: ...\n    def is_signed_in(self) -\u003e bool: ...\n    def is_signed_out(self) -\u003e bool: ...\n    def post(self, details: dict) -\u003e str: ...\n    def sign_in(self, details: dict, cookies: str = None) -\u003e NoReturn: ...\n    def sign_out(self) -\u003e NoReturn: ...\n\n    \"\"\" from base.py \"\"\"\n    def find_element(self, locator: U[WebElement, str], required: bool=True,\n            parent: U[WebDriver, WebElement]=None) -\u003e WebElement : ...\n    def find_elements(self, locator: str, required: bool=False,\n            parent: U[WebDriver, WebElement]=None) -\u003e List[WebElement] : ...\n    def is_text_present(self, text: str) -\u003e bool: ...\n    def is_element_enabled(self, locator: U[WebElement, str], tag: str=None) -\u003e bool: ...\n    def is_visible(self, locator: U[WebElement, str]) -\u003e bool: ...\n\n    \"\"\" from alert.py \"\"\"\n    def get_alert(self, timeout: int=DEFAULT_TIMEOUT, message: str ='') -\u003e Alert: ...\n    def get_alert_text(self, timeout: int=DEFAULT_TIMEOUT) -\u003e str: ...\n    def handle_alert(self, action: str='accept', timeout: int=DEFAULT_TIMEOUT) -\u003e str: ...\n    def input_text_into_alert(self, text: str, action: str='accept',\n            timeout: int=None) -\u003e str: ...\n\n    \"\"\" from browsermanagement.py \"\"\"\n    def back(self) -\u003e NoReturn: ...\n    def forward(self) -\u003e NoReturn: ...\n    def get_session_id(self) -\u003e str: ...\n    def get_source(self) -\u003e str: ...\n    def get_title(self) -\u003e str: ...\n    def get_url(self) -\u003e str: ...\n    def goto(self, url: str) -\u003e NoReturn: ...\n    def refresh(self) -\u003e NoReturn: ...\n    def quit(self) -\u003e NoReturn: ...\n\n    \"\"\" from cookies.py \"\"\"\n    def add_cookie(self, cookie_dict: dict) -\u003e NoReturn: ...\n    def delete_all_cookies(self) -\u003e NoReturn: ...\n    def delete_cookie(self, name: str) -\u003e NoReturn: ...\n    def get_cookie(self, name:str) -\u003e U[str, None]: ...\n    def get_cookies(self) -\u003e List[dict]: ...\n    def load_cookies(self, filename: str, path: str='default') -\u003e NoReturn: ...\n    def save_cookies(self, filename: str) -\u003e str: ...\n    def set_cookies_directory(self, path: str=None, append: bool=True) -\u003e str: ...\n    def set_cookies_expiry(self, date: int=3735325880) -\u003e NoReturn: ...\n\n    \"\"\" from element.py \"\"\"\n    def clear_element_text(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def click_element(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def click_element_at_coordinates(self, locator: U[WebElement, str],\n            xoffset: int, yoffset: int) -\u003e NoReturn: ...\n    def double_click_element(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def drag_and_drop(self, locator: U[WebElement, str],\n            target: U[WebElement, str]) -\u003e NoReturn: ...\n    def element_text_contains(self, locator: U[WebElement, str], expected: str,\n            ignore_case: bool=True) -\u003e bool: ...\n    def element_text_is(self, locator: U[WebElement, str], expected: str,\n            ignore_case: bool=False) -\u003e bool: ...\n    def get_element_attribute(self, locator: U[WebElement, str], attribute: str) -\u003e str: ...\n    def get_element_property(self, locator: U[WebElement, str], prop: str) -\u003e str: ...\n    def get_element_size(self, locator: U[WebElement, str]) -\u003e (int, int): ...\n    def get_text(self, locator: U[WebElement, str]) -\u003e str: ...\n    def page_contains_text(self, text:str) -\u003e bool: ...\n    def right_click_element_at_coordinates(self, locator: U[WebElement, str],\n            xoffset: int, yoffset: int) -\u003e NoReturn: ...\n    def send_keys(self, locator: U[WebElement, str]=None,\n            *keys: U[List[str], str]) -\u003e NoReturn: ...\n    def highlight_elements(self, locator: U[List[WebElement], WebElement, str],\n            tag: str=None) -\u003e NoReturn: ...\n    def set_focus_to_element(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def mouse_down(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def mouse_out(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def mouse_over(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def mouse_up(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def scroll_element_into_view(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def simulate_event(self, locator: U[WebElement, str], event: str) -\u003e NoReturn: ...\n\n    \"\"\" from frames.py \"\"\"\n    def send_method_to_element_in_frame(self, frame_locator: U[WebElement, str, int],\n            element_locator: U[WebElement, str], method: Callable) -\u003e Any: ...\n    def switch_to_frame(self, locator: U[WebElement, str, int]) -\u003e NoReturn: ...\n    def unselect_frame(self) -\u003e NoReturn: ...\n\n    \"\"\" from javascript.py \"\"\"\n    def execute_javascript(self, script, *args: List[str]) -\u003e Any: ...\n    def execute_async_javascript(self, script, *args: List[str]) -\u003e Any: ...\n\n    \"\"\" from screenshot.py \"\"\"\n    def capture_element_screenshot(self, locator: U[WebElement, str],\n            filename: str='element-screenshot-{index:03}.png') -\u003e str: ...\n    def capture_page_screenshot(self, filename: str='screenshot-{index:03}.png') -\u003e str: ...\n    def set_screenshot_directory(self, path: str=None, append: bool=True) -\u003e str: ...\n\n    \"\"\" from selects.py \"\"\"\n    def get_select_items(self, locator: U[WebElement, str], values:bool=False) -\u003e List[str]: ...\n    def get_selected_item(self, locator: U[WebElement, str], values: bool=False) -\u003e str: ...\n    def select_all_from_multilist(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def select_from_list_by_index(self, locator: U[WebElement, str],\n            *indexes: str) -\u003e NoReturn: ...\n    def select_from_list_by_value(self, locator: U[WebElement, str],\n            *values: str) -\u003e NoReturn: ...\n    def select_from_list_by_label(self, locator: U[WebElement, str],\n            *labels: str) -\u003e NoReturn: ...\n    def unselect_all_from_list(self, locator: U[WebElement, str]) -\u003e NoReturn: ...\n    def unselect_from_list_by_index(self, locator: U[WebElement, str],\n            *indexes: str) -\u003e NoReturn: ...\n    def unselect_from_list_by_value(self, locator: U[WebElement, str],\n            *values: str) -\u003e NoReturn: ...\n    def unselect_from_list_by_label(self, locator: U[WebElement, str],\n            *labels: str) -\u003e NoReturn: ...\n\n    \"\"\" from tables.py \"\"\"\n    def get_table_cell_by_index(self, locator: U[WebElement, str],\n            row: U[str, int], column: U[str, int]) -\u003e WebElement: ...\n    def get_table_cell_text(self, locator: U[WebElement, str],\n            row: U[str, int], column: U[str, int]) -\u003e U[str, None]: ...\n    def get_table_cell_by_text(self, locator: U[WebElement, str],\n            text: str) -\u003e str: ...\n    def get_table_row_by_index(self, locator: U[WebElement, str],\n            row: U[str, int]) -\u003e List[WebElement]: ...\n    def get_table_row_by_text(self, locator: U[WebElement, str],\n            text: str) -\u003e List[WebElement]: ...\n\n    \"\"\" from waiting.py \"\"\"\n    def wait_for_element(self, locator: U[WebElement, str], negate:bool =False,\n            timeout: int=DEFAULT_TIMEOUT,\n            parent: U[WebDriver, WebElement]=None) -\u003e WebElement: ...\n    def wait_for_element_to_be_enabled(self, locator: U[WebElement, str],\n            negate: bool=False, timeout: int=DEFAULT_TIMEOUT) -\u003e WebElement : ...\n    def wait_for_element_to_be_visible(self, locator, negate=False,\n            timeout=DEFAULT_TIMEOUT) -\u003e WebElement: ...\n    def wait_for_element_to_contain(self, locator: U[WebElement, str],\n            text: str, negate: bool=False,\n            timeout: int=DEFAULT_TIMEOUT) -\u003e WebElement: ...\n    def wait_for_script(self, condition: str, negate: bool=False,\n            timeout: int=DEFAULT_TIMEOUT, message: str='msg') -\u003e Any: ...\n    def wait_for_page_to_contain(self, text: str, negate:bool =False,\n            timeout: int=DEFAULT_TIMEOUT)-\u003ebool: ...\n\n    \"\"\" from windowmanager.py \"\"\"\n    def select_window(self, locator: U[List[str], str], timeout:int=None) -\u003e str: ...\n    def close_window(self) -\u003e NoReturn: ...\n    def get_all_windows_handles(self) -\u003e List[str]: ...\n    def get_all_windows_ids(self) -\u003e List[str]: ...\n    def get_all_windows_names(self) -\u003e List[str]: ...\n    def get_all_windows_titles(self) -\u003e List[str]: ...\n    def get_all_windows_urls(self) -\u003e List[str]: ...\n    def get_window_handle(self) -\u003e str: ...\n    def get_window_info(self) -\u003e NamedTuple: ...\n    def get_window_position(self) -\u003e Tuple[int,int]: ...\n    def get_window_size(self) -\u003e Tuple[int,int]: ...\n    def maximize_browser_window(self) -\u003e NoReturn: ...\n    def set_window_id(self, id: U[str, int]) -\u003e NoReturn: ...\n    def set_window_name(self, name: U[str, int]) -\u003e NoReturn: ...\n    def set_window_position(self, x: U[str, int], y: U[str, int]) -\u003e NoReturn: ...\n    def set_window_size(self, width: U[str, int],\n            height: U[str, int]) -\u003e NoReturn: ...\n\n\nSite-specific methods\n---------------------\n\nAdditional site-specific methods are available, but a site must be set first.\nThis ca be done using ``Browser.set_site_behaviour(SiteBehaviour)``\n\nFor instance, before you can use 'sign_in' or 'create_account', you must indicate\nfor which site you would like this behaviour to occur.\n\n.. code-block:: python\n\n    chrome = Browser('chrome')\n\n    chrome.set_site_behaviour(Facebook)\n    chrome.sign_in(credentials)\n    chrome.post_content(details)\n    chrome.sign_out()\n\n    chrome.set_site_behaviour(X)\n    chrome.sign_in(credentials)\n    chrome.post_content(ad)\n    chrome.sign_out()\n\nThe following are site-specific methods which require a site to be set first.\n\n.. code-block:: python\n\n    def create_account(self, details: dict, cookies: str = None): ...\n    def create_content(self, details: dict) -\u003e str: ...\n    def delete_content(self, details: dict) -\u003e bool: ...\n    def edit_content(self, details: dict) -\u003e bool: ...\n    def is_signed_in(self) -\u003e bool: ...\n    def is_signed_out(self) -\u003e bool: ...\n    def sign_in(self, details: dict, cookies: str = None) -\u003e NoReturn: ...\n    def sign_out(self) -\u003e NoReturn: ...\n\nEnvironment Variables\n---------------------\n\nThe following environment variables can be set to configure various aspects of the Selenium2 behavior:\n\n``DEBUG``\n    Controls the debug output of the Selenium2 wrapper. Set to ``False`` to disable verbose logging.\n    Default is ``True``.\n\n    .. code-block:: bash\n\n        export SELENIUM2_DEBUG=True\n\n``SELENIUM2_DEFAULT_TIMEOUT``\n    Specifies the default timeout in seconds for explicit waits.\n    Default is 15 seconds.\n\n    .. code-block:: bash\n\n        export SELENIUM2_DEFAULT_TIMEOUT=30\n\n``SELENIUM2_SCREENSHOT_PATH``\n    Sets the directory where screenshots will be saved.\n    Default is 'screenshots'.\n\n    .. code-block:: bash\n\n        export SELENIUM2_SCREENSHOT_PATH='/path/to/screenshots'\n\n``SELENIUM2_REPORT_PATH``\n    Sets the directory where test results will be saved.\n    Default is 'reports'.\n\n    .. code-block:: bash\n\n        export SELENIUM2_SCREENSHOT_PATH='/path/to/reports'\n\n``SELENIUM2_COOKIE_PATH``\n    Defines the directory for storing browser cookies.\n    Default is 'cookies'.\n\n    .. code-block:: bash\n\n        export SELENIUM2_COOKIE_PATH='/path/to/cookies'\n\nThese environment variables allow you to customize the behavior of the Selenium2 wrapper without changing the code. They are particularly useful for adapting the wrapper to different testing environments or requirements.\n\nContributing\n------------\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nLicense\n-------\n\nApache 2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floudpumpkins%2Fselenium2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floudpumpkins%2Fselenium2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floudpumpkins%2Fselenium2/lists"}