{ "info": { "author": "['Soumyajit Basu', 'Bony Roopchandani']", "author_email": "soumyajit.basu62@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing" ], "description": "# Browserium\n\n![Browserium logo](https://farm2.staticflickr.com/1742/41852028144_642310d9b6_m.jpg)\n\n**Browserium** is the a selenium wrapper for all **browsers** and **browser** **configurations**. This module is a single end point to access all the browser drivers and as well as the webdriver object for all the respective browsers along with the installation of your **selenium** module.\n\n## Problem Statement\nWith the very fast pace of development, it has now become very important to have regular release cycle and with it it should be also kept in mind that we do a quality release. For this reason we have to have our tests automated as well so that we can have a centralised reports for regressions and other flaws in the system at the end of each build.\n\nNow, for a stable build we have to check that our application is compatible with different browsers and platforms. When we start implementing a framework based out of Selenium WebDriver, for the code to get executed in different browsers we have to configure each of the browsers separately and make a call to the browser based on the requirement. Phewww !! That is some good amount of code written.\n\n## The Idea\nThe problem statement that has been defined above was the reason I took out time to ease this entire process of setting up the browser drivers and the respective configurations for each browser. What if this process can be reduced down into few steps of execution? That is how I ended up with the idea and the implementation of **Browserium**.\n\n## Features covered up by 'Browserium'\n* One step to **download** the required browser drivers.\n* One step to **update** the required browser drivers.\n* Create a **single** **instance** for your required browser object. No more code required to configure your browsers separately.\n* A set of browser related **generic** **functions** that can be utilised for debugging as well as for achieving the required functionalities. So, we are reducing quite an effort over here as well !!\n* You can run browsers **Chrome** and **Firefox** using the **headless** option as well so that it is comfortable running your framework on the server as well.\n\n## Browserium by functionality\n![functionality screenshot](https://farm2.staticflickr.com/1750/41853754714_971a727962.jpg)\n\nThere are two ways in which you can use Browserium.\n\n* Download the required browser driver, create instance for the specific browser driver class.\n* Download the required browser driver, create instance for the specific browser driver class, create instance for the browser controller class and use the generic functions to get started with your framework.\n\nYou can refer to the above diagram for reference.\n\n## Installing and Updating driver packages\n\n### Install Browserium module\n* To install Browserium using PiP run the command:\n\n\t `pip install browserium`\n\n* To install Browserium from GitHub run the command:\n\n\t `pip install git+git://github.com/browserium/Browserium.git`\n\n### Modules installed with browserium\n* **requests**\n* **selenium**\n* **wget**\n\nMake sure you have **ssh** configured in GitHub. You can also use **https** as well to install the module. But preferrable would be if you have **ssh** configured in GitHub.\n\nTo install Browserium from GitHub using HTTPS run the command:\n\n\tpip install git+https://github.com/browserium/Browserium.git\n\n* To download chromedriver run the command\n\n\t ```browserium download --driver=chromedriver```\n\n* To download geckodriver run the command\n\n\t ```browserium download --driver=geckodriver```\n\n* To download operadriver run the command\n\n\t ```browserium download --driver=operadriver```\n\n### Update Drivers\n* To update chromedriver run the command\n\n\t ```browserium update --driver=chromedriver```\n\n* To update geckodriver run the command\n\n\t ```browserium update --driver=geckodriver```\n\n* To update operadriver run the command\n\n\t ```browserium update --driver=operadriver```\n\n## Get started with Browserium\n### Browser Controller class by functionality\nThe `Browser Controller` class provides you with some eccentric methods that can be utilised to achieve the required functions.\n\n* get_url(driver, url): request the required url entered. Pass the required driver object and the 'url' as parameters.\n\n* implicit_wait_time(driver, time): Apply implicit wait before the dom loads. Pass the required driver object and the time as parameters.\n\n* set_window_size(driver, height, width): Set the window size for the current running browser. Pass the required driver object, height and the width of the window.\n\n* get_current_url(driver): Get the current url. Pass the required driver object as parameter.\n\n* get_network_requests(driver): Get all the network requests for the current page. Pass the required driver object as parameter.\n\n* performance_metrics(driver): Get required page performance data. Pass the required driver object as parameter.\n\n* check_console_logs(driver): Get all console logs. Pass the required driver object as parameter.\n\n* get_page_source(driver): Get the current page source. Pass the required driver object as parameter.\n\n* get_site_cookies(driver): Get all the site cookies. Pass the required driver object as parameter.\n\n### Create instance for Chrome\n* Create instance for the `ChromeDriverObject` class\n* Use the instance for `ChromeDriverObject` class to call the `set_chromedriver_object` method.\n* Create instance for the `Browser_controller` class to use the generic methods.\n\n```python\n\tfrom browserium.generic_functions.chrome_object import ChromeDriverObject\n\tfrom browserium.generic_functions.browser_controller import Browser_controller\n\tfrom time import sleep\n\n\tclass Test_1():\n\t\tdef test_chromedriver_type1(self):\n\t\t\tchromedriver = ChromeDriverObject()\n\t\t\tcontroller = Browser_controller()\n\t\t\tdriver = chromedriver.set_chromedriver_object()\n\t\t\tcontroller.get_url(driver, \"https://www.google.co.in\")\n\t\t\tcontroller.implicit_wait_time(driver, 4)\n\t\t\tcurrent_url = controller.get_current_url(driver)\n\t\t\tprint current_url\n```\n* To run chromedriver using the `headless` feature you have to pass the argument '--headless' in the `set_chromedriver_object()` method\n\n```python\n\tfrom browserium.generic_functions.chrome_object import ChromeDriverObject\n\tfrom browserium.generic_functions.browser_controller import Browser_controller\n\tclass Test_1():\n\t\tdef test_chromedriver_type1(self):\n\t\t\tchromedriver = ChromeDriverObject()\n\t\t\tcontroller = Browser_controller()\n\t\t\tdriver = chromedriver.set_chromedriver_object('--headless')\n\t\t\tcontroller.get_url(driver, \"https://www.google.co.in\")\n\t\t\tcontroller.implicit_wait_time(driver, 4)\n\t\t\tcurrent_url = controller.get_current_url(driver)\n\t\t\tprint current_url\n```\n\n### Create instance for Firefox\n* Create instance for the `GeckoDriverObject` class\n* Use the instance for `GeckoDriverObject` class to call the `set_geckodriver_object` method.\n* Create instance for the `Browser_controller` class to use the generic methods.\n\n```python\n\tfrom browserium.generic_functions.gecko_object import GeckoDriverObject\n\tfrom browserium.generic_functions.browser_controller import Browser_controller\n\tclass Test1():\n\t\tdef test_geckodriver_type1(self):\n\t\t\tgeckodriver = GeckoDriverObject()\n\t\t\tcontroller = Browser_controller()\n\t\t\tdriver = geckodriver.set_geckodriver_object()\n\t\t\tcontroller.implicit_wait_time(driver, 4)\n\t\t\tcontroller.get_url(driver, \"https://www.google.co.in\")\n\t\t\tcurrent_url = controller.get_current_url(driver)\n\t\t\tprint current_url\n\t\t\tprint driver.title\n```\n* To run geckodriver using the `headless` feature you have to pass the argument '--headless' in the `set_geckodriver_object()` method\n\n```python\n\tfrom browserium.generic_functions.gecko_object import GeckoDriverObject\n\tfrom browserium.generic_functions.browser_controller import Browser_controller\n\tclass Test1():\n\t\tdef test_geckodriver_type1(self):\n\t\t\tgeckodriver = GeckoDriverObject()\n\t\t\tcontroller = Browser_controller()\n\t\t\tdriver = geckodriver.set_geckodriver_object('--headless')\n\t\t\tcontroller.implicit_wait_time(driver, 4)\n\t\t\tcontroller.get_url(driver, \"https://www.google.co.in\")\n\t\t\tcurrent_url = controller.get_current_url(driver)\n\t\t\tprint current_url\n\t\t\tprint driver.title\n```\n\n### Create instance for Opera\n* Create instance for the `OperaDriverObject` class\n* Use the instance for `OperaDriverObject` class to call the `set_operadriver_object` method\n* Create instance for the `Browser_controller` class to use the generic methods.\n\n```python\n\tfrom browserium.generic_functions.opera_object import OperaDriverObject\n\tfrom browserium.generic_functions.browser_controller import Browser_controller\n\tclass Test1():\n\t\tdef test_operadriver_type1(self):\n\t\t\toperadriver = OperaDriverObject()\n\t\t\tcontroller = Browser_controller()\n\t\t\tdriver = operadriver.set_operadriver_object()\n\t\t\tcontroller.implicit_wait_time(driver, 4)\n\t\t\tcontroller.get_url(driver, \"https://www.google.co.in\")\n\t\t\tcurrent_url = controller.get_current_url(driver)\n\t\t\tprint current_url\n\t\t\tprint driver.title\n```\n\n### Create instance for Safari\n* Create instance for the `SafariDriverObject` class\n* Use the instance for `SafariDriverObject` class to call the `set_safaridriver_object` method\n* Create instance for the `Browser_controller` class to use the generic methods.\n\n```python\n\tfrom browserium.generic_functions.safari_object import SafariDriverObject\n\tfrom browserium.generic_functions.browser_controller import Browser_controller\n\tclass Test_1():\n\t\tdef test_safaridriver_type1(self):\n\t\t\tsafaridriver = SafariDriverObject()\n\t\t\tcontroller = Browser_controller()\n\t\t\tdriver = safaridriver.set_safaridriver_object()\n\t\t\tcontroller.get_url(driver, \"https://www.google.co.in\")\n\t\t\tcontroller.implicit_wait_time(driver, 4)\n\t\t\tcurrent_url = controller.get_current_url(driver)\n\t\t\tprint current_url\n\t\t\tprint driver.title\n\t\t\tdriver.quit()\n```\nP.S: Safaridriver comes shipped with the Safari browser by default. You have to enable the `Allow Remote Automation` option from the `Develop` menu. Please check this screenshot.\n![Safari](https://farm2.staticflickr.com/1738/28757957868_38fff165d4.jpg)\n\nKeep in mind that your safari version has to be more than 10. If it is not 10 or more than 10 then please update your Safari version.\n\n### Deleting all browser driver\nTo delete all browser drivers from `/usr/local/bin` run the command:\n\n ```browserium delete --driver=all```\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1d8f7a6f46bc4182992b04c7f9b51447)](https://www.codacy.com/app/Corefinder89/Browserium?utm_source=github.com&utm_medium=referral&utm_content=browserium/Browserium&utm_campaign=Badge_Grade)\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/browserium/Browserium/archive/2.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/browserium/Browserium", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "browserium", "package_url": "https://pypi.org/project/browserium/", "platform": "", "project_url": "https://pypi.org/project/browserium/", "project_urls": { "Download": "https://github.com/browserium/Browserium/archive/2.0.tar.gz", "Homepage": "https://github.com/browserium/Browserium" }, "release_url": "https://pypi.org/project/browserium/2.0/", "requires_dist": [ "requests", "wget", "selenium", "pytest-html" ], "requires_python": "", "summary": "A single endpoint for your browser driver configuration", "version": "2.0" }, "last_serial": 5138534, "releases": { "1.1.2": [ { "comment_text": "", "digests": { "md5": "ba771ca4272e8cfc43ebcea98e052e66", "sha256": "cc17fe29d6e70a260001be401bbe1fe66ffc22eef627ded44c5aa1bf355e1e68" }, "downloads": -1, "filename": "browserium-1.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "ba771ca4272e8cfc43ebcea98e052e66", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 20514, "upload_time": "2019-01-08T07:04:06", "url": "https://files.pythonhosted.org/packages/98/2e/908b5531e1f63df282765c9f3254ff5d64ea58591a56d3cc094a0e74c5f8/browserium-1.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d094b37307172e8711d78587d272cdbd", "sha256": "13a61dd5574f005b69b533aa3ec4d5f2b1e1ab31450ec8bd34b319d3fc3a8441" }, "downloads": -1, "filename": "browserium-1.1.2.tar.gz", "has_sig": false, "md5_digest": "d094b37307172e8711d78587d272cdbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11527, "upload_time": "2019-01-08T07:04:08", "url": "https://files.pythonhosted.org/packages/a4/0d/1ec1f86af7918f21580fa50016804f76d817949cb3af032133466be7ebd7/browserium-1.1.2.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "520e3a16636d1553da17b6bffe4f0441", "sha256": "d9a0395c921dedf92db03aecfec93af108fc340d5173f3d8718a7c296f47437d" }, "downloads": -1, "filename": "browserium-1.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "520e3a16636d1553da17b6bffe4f0441", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 19689, "upload_time": "2019-01-26T10:36:44", "url": "https://files.pythonhosted.org/packages/d1/ac/fa4df10a783f53840040b2e7b8e1485b5cd17518e6195a1de6fed0a0ecbc/browserium-1.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "18bc351344766e5e76aafa1a6f6f0eb7", "sha256": "f064508a5f66cd31b90782a6b956fd6ddabb2c21bbe42016957f7130fae35b01" }, "downloads": -1, "filename": "browserium-1.2.2.tar.gz", "has_sig": false, "md5_digest": "18bc351344766e5e76aafa1a6f6f0eb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11316, "upload_time": "2019-01-26T10:36:45", "url": "https://files.pythonhosted.org/packages/27/96/3c6750056b5858a71e148e81452a7e200570190bec6b849370a583b25189/browserium-1.2.2.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "9231ff55fa0d7e9f9635b82f53022e89", "sha256": "1f1468844c50ec4683866a4061bc97760aafb8e2243dfbaec240b73e22aaea89" }, "downloads": -1, "filename": "browserium-2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9231ff55fa0d7e9f9635b82f53022e89", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19692, "upload_time": "2019-04-13T16:22:44", "url": "https://files.pythonhosted.org/packages/bc/b9/4f4a0de4cfb6ab983faa94ba30c606c8a98d55dcf8f1ebb8f8537bc2ab4e/browserium-2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b231b63c34f3a921d320f334613bbb9", "sha256": "17f7fac9acc785e26112b3064065f3136bee2444d8899c184ad52b081045d6f5" }, "downloads": -1, "filename": "browserium-2.0.tar.gz", "has_sig": false, "md5_digest": "8b231b63c34f3a921d320f334613bbb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14093, "upload_time": "2019-04-13T16:22:46", "url": "https://files.pythonhosted.org/packages/c8/c8/991ac68ebdd3317a88dffe1ac372fff381707cb44929c091452b256053c0/browserium-2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9231ff55fa0d7e9f9635b82f53022e89", "sha256": "1f1468844c50ec4683866a4061bc97760aafb8e2243dfbaec240b73e22aaea89" }, "downloads": -1, "filename": "browserium-2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9231ff55fa0d7e9f9635b82f53022e89", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19692, "upload_time": "2019-04-13T16:22:44", "url": "https://files.pythonhosted.org/packages/bc/b9/4f4a0de4cfb6ab983faa94ba30c606c8a98d55dcf8f1ebb8f8537bc2ab4e/browserium-2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b231b63c34f3a921d320f334613bbb9", "sha256": "17f7fac9acc785e26112b3064065f3136bee2444d8899c184ad52b081045d6f5" }, "downloads": -1, "filename": "browserium-2.0.tar.gz", "has_sig": false, "md5_digest": "8b231b63c34f3a921d320f334613bbb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14093, "upload_time": "2019-04-13T16:22:46", "url": "https://files.pythonhosted.org/packages/c8/c8/991ac68ebdd3317a88dffe1ac372fff381707cb44929c091452b256053c0/browserium-2.0.tar.gz" } ] }