# Selenium for Python
[![Latest Version](https://img.shields.io/pypi/v/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)
[![License](https://img.shields.io/pypi/l/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)
[![Build Status](https://github.com/Polmik/py-selenium-auto/actions/workflows/tests.yml/badge.svg)](https://github.com/Polmik/py-selenium-auto/actions/workflows/tests.yml)
[![Coverage Status](https://codecov.io/gh/Polmik/py-selenium-auto/branch/main/graph/badge.svg)](https://codecov.io/gh/Polmik/py-selenium-auto)
[![Supported Python implementations](https://img.shields.io/pypi/implementation/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
### Introduction
This package is a library designed to simplify your work with Selenium WebDriver and based on [py-selenium-auto-core](https://github.com/Polmik/py-selenium-auto-core) solution.
### Supported browsers
* Chrome
**Note: Support for popular browsers will be expanded in the future**
### Supported Python Versions
* Python 3.7-3.9
### Installation
If you have [pip](https://pip.pypa.io/en/stable/) on your system, you can simply install or upgrade the Python bindings:
```bash
pip install -U py-selenium-auto
```
Alternately, you can download the source distribution from [PyPI](https://pypi.org/project/py-selenium-auto/#files), unarchive it, and run:
```bash
python setup.py install
```
### Template
To start the project using this solution, you can look into [py-selenium-auto-template
](https://github.com/Polmik/py-selenium-auto-template).
### Quick start
1. Add the dependency in your project
2. Create conftest.py file and add the following code:
```python
@pytest.fixture(scope="session", autouse=True)
def setup_session(request):
# TODO: workaround to set calling root path, because pytest runs from the root dir
work_dir = RootPathHelper.current_root_path(__file__)
os.chdir(work_dir)
```
It's necessary to set root dir for your test directory. It is assumed that your project structure will look like this:
```
src/
__init__.py
some_code/
tests/ # Any name
__init__.py
resources/
some_code/
```
3. Create instance of Browser in your test:
```python
browser = BrowserServices.Instance.browser
```
4. Use Browser's methods directly for general actions, such as navigation, window resize, scrolling and alerts handling:
```python
browser.maximize()
browser.go_to("https://google.com")
browser.wait_for_page_to_load()
```
5. Use ElementFactory class's methods to get an instance of each element:
```python
my_text_box = BrowserServices.Instance.service_provider.element_factory().get_text_box(Locator.by_xpath("XPATH"), "Name")
```
Or you can inherit a class from Form class and use existing ElementFactory:
```python
self.my_text_box = self._element_factory.get_text_box(Locator.by_xpath("XPATH"), "Name")
```
6. Call element's methods to perform action with element:
```python
my_text_box.type("example@email.com")
```
7. Quit browser at the end:
```python
browser.quit()
```
### Configuration
This file is used to configure your browser settings, as well as other settings.By default, your solution will use the file from this project.
Copy the [following file](https://github.com/Polmik/py-selenium-auto/blob/main/py_selenium_auto/resources/settings.json) to your solution in `tests/resources` to configure it yourself
### License
Library's source code is made available under the [Apache 2.0 license](https://github.com/Polmik/py-selenium-auto/blob/main/LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/Polmik/py-selenium-auto",
"name": "py-selenium-auto",
"maintainer": "Egor Ryaboshapko",
"docs_url": null,
"requires_python": "",
"maintainer_email": "mrpolmik@hotmail.com",
"keywords": "testing,selenium,driver,test automation",
"author": "Egor Ryaboshapko",
"author_email": "mrpolmik@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/e6/db/7e569e32989b5b9e1b193a085e73ea6141bd6e28dbb69d5dfbb950dc6a24/py-selenium-auto-0.4.5.tar.gz",
"platform": "any",
"description": "# Selenium for Python\n\n[![Latest Version](https://img.shields.io/pypi/v/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)\n[![License](https://img.shields.io/pypi/l/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)\n[![Build Status](https://github.com/Polmik/py-selenium-auto/actions/workflows/tests.yml/badge.svg)](https://github.com/Polmik/py-selenium-auto/actions/workflows/tests.yml)\n[![Coverage Status](https://codecov.io/gh/Polmik/py-selenium-auto/branch/main/graph/badge.svg)](https://codecov.io/gh/Polmik/py-selenium-auto)\n[![Supported Python implementations](https://img.shields.io/pypi/implementation/py_selenium_auto.svg)](https://pypi.org/project/py-selenium-auto/)\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n### Introduction\n\nThis package is a library designed to simplify your work with Selenium WebDriver and based on [py-selenium-auto-core](https://github.com/Polmik/py-selenium-auto-core) solution.\n\n### Supported browsers\n* Chrome\n\n**Note: Support for popular browsers will be expanded in the future**\n\n### Supported Python Versions\n\n* Python 3.7-3.9\n\n### Installation \n\nIf you have [pip](https://pip.pypa.io/en/stable/) on your system, you can simply install or upgrade the Python bindings:\n\n```bash\npip install -U py-selenium-auto\n```\n\nAlternately, you can download the source distribution from [PyPI](https://pypi.org/project/py-selenium-auto/#files), unarchive it, and run:\n\n```bash\npython setup.py install\n```\n\n### Template\n\nTo start the project using this solution, you can look into [py-selenium-auto-template\n](https://github.com/Polmik/py-selenium-auto-template).\n\n### Quick start\n\n1. Add the dependency in your project\n2. Create conftest.py file and add the following code:\n```python\n@pytest.fixture(scope=\"session\", autouse=True)\ndef setup_session(request):\n # TODO: workaround to set calling root path, because pytest runs from the root dir\n work_dir = RootPathHelper.current_root_path(__file__)\n os.chdir(work_dir)\n```\n\nIt's necessary to set root dir for your test directory. It is assumed that your project structure will look like this:\n```\nsrc/\n __init__.py\n some_code/\ntests/ # Any name\n __init__.py\n resources/\n some_code/\n```\n3. Create instance of Browser in your test:\n```python\nbrowser = BrowserServices.Instance.browser\n```\n4. Use Browser's methods directly for general actions, such as navigation, window resize, scrolling and alerts handling:\n```python\nbrowser.maximize()\nbrowser.go_to(\"https://google.com\")\nbrowser.wait_for_page_to_load()\n```\n5. Use ElementFactory class's methods to get an instance of each element:\n```python\nmy_text_box = BrowserServices.Instance.service_provider.element_factory().get_text_box(Locator.by_xpath(\"XPATH\"), \"Name\")\n```\nOr you can inherit a class from Form class and use existing ElementFactory:\n```python\nself.my_text_box = self._element_factory.get_text_box(Locator.by_xpath(\"XPATH\"), \"Name\")\n```\n6. Call element's methods to perform action with element:\n```python\nmy_text_box.type(\"example@email.com\")\n```\n7. Quit browser at the end:\n```python\nbrowser.quit()\n```\n\n### Configuration\nThis file is used to configure your browser settings, as well as other settings.By default, your solution will use the file from this project.\n\nCopy the [following file](https://github.com/Polmik/py-selenium-auto/blob/main/py_selenium_auto/resources/settings.json) to your solution in `tests/resources` to configure it yourself\n\n### License\nLibrary's source code is made available under the [Apache 2.0 license](https://github.com/Polmik/py-selenium-auto/blob/main/LICENSE).\n",
"bugtrack_url": null,
"license": "Apache",
"summary": "Selenium for Python",
"version": "0.4.5",
"project_urls": {
"Homepage": "https://github.com/Polmik/py-selenium-auto"
},
"split_keywords": [
"testing",
"selenium",
"driver",
"test automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "72dc89d96335386081495b783170d67af3ba38f72072421e55d2b341961510a4",
"md5": "bcdbfbb085fd35db1358cdf2e255c44c",
"sha256": "577f6e33b15c0b1dc80bae8c2f79c64ac9a7040d833675abcdff18ce395259bb"
},
"downloads": -1,
"filename": "py_selenium_auto-0.4.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bcdbfbb085fd35db1358cdf2e255c44c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 59056,
"upload_time": "2023-12-05T08:45:29",
"upload_time_iso_8601": "2023-12-05T08:45:29.470098Z",
"url": "https://files.pythonhosted.org/packages/72/dc/89d96335386081495b783170d67af3ba38f72072421e55d2b341961510a4/py_selenium_auto-0.4.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e6db7e569e32989b5b9e1b193a085e73ea6141bd6e28dbb69d5dfbb950dc6a24",
"md5": "ef5e546982639e21f613e1832039e93b",
"sha256": "4175043c31819a235619e69a139499f9316c28620b8da8d1590bac4251d0a7aa"
},
"downloads": -1,
"filename": "py-selenium-auto-0.4.5.tar.gz",
"has_sig": false,
"md5_digest": "ef5e546982639e21f613e1832039e93b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36936,
"upload_time": "2023-12-05T08:45:31",
"upload_time_iso_8601": "2023-12-05T08:45:31.134920Z",
"url": "https://files.pythonhosted.org/packages/e6/db/7e569e32989b5b9e1b193a085e73ea6141bd6e28dbb69d5dfbb950dc6a24/py-selenium-auto-0.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-05 08:45:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Polmik",
"github_project": "py-selenium-auto",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "py-selenium-auto"
}