{ "info": { "author": "Milan Falesnik", "author_email": "milan@falesnik.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "selenium-smart-locator\n======================\n\n|Build Status| |Coverage Status| |Code Health|\n\nClass encapsulating generating of the Selenium locators.\n\nIt is designed to be simple and intuitive to use. It provides you various ways how to generate a\nSelenium-compatible locators. The class is usable in Selenium element queries.\n\n.. code-block:: python\n\n loc = Locator(By.XPATH, '//foo/bar/baz') # Old selenium way of doing it\n element = s.find_element(*loc) # Expand the tuple. That's how to use the class.\n\nThis is a basic sample of how does it work. Now come the usage samples of simplified locators:\n\n.. code-block:: python\n\n # When you use this simple format of CSS consisting of tag name, ids and classes, it gets\n # detected automatically and the result is a CSS selector. IDs and classes are optional.\n Locator('div#foo.bar.baz') # => Locator(by='css selector', locator='div#foo.bar.baz')\n # When you specify a plain string and it does not get matched be the preceeding CSS detector\n # it is assumed it is an XPath expression\n Locator('//h1') # => Locator(by='xpath', locator='//h1')\n # If you pass a Locator instance, it just goes straight through\n Locator(Locator('//h1')) # => Locator(by='xpath', locator='//h1')\n # If you have your own object, that implements __locator__(), then it can also be resolved\n # by the class. The __locator__() must either return Locator instance or\n # anything that Locator can process.\n Locator(my_obj)\n # You can leverage kwargs to say strategy=locator\n Locator(xpath='//h1') # => Locator(by='xpath', locator='//h1')\n Locator(css='#something') # => Locator(by='css selector', locator='#something')\n Locator(by='xpath', locator='//h1') # => Locator(by='xpath', locator='//h1')\n # For your comfort, you can pass a dictionary, like it was kwargs\n Locator({'by': 'xpath', 'locator': '//h1'}) # => Locator(by='xpath', locator='//h1')\n # You can also use Locator's classmethods, like this:\n Locator.by_css('#foo') # => Locator(by='css selector', locator='#foo')\n # Always in format Locator.by_\n\nWhen you have locators, you can avoid using ``*`` by using convenience methods:\n\n.. code-block:: python\n\n l = Locator('#foo')\n browser = Firefox()\n element = l.find_element(browser)\n elements = l.find_elements(browser)\n\nAs you can see, the number of ways how to specify the input parameters offer you a great freedom\non how do you want to structure your locators. You can store them in YAML and you can use\nLocator to parse the entries. Or anything else.\n\nAvailable selector strategies:\n\n* class_name\n* css\n* id\n* link_text\n* name\n* partial_link_text\n* tag\n* xpath\n\n\nLicense\n=======\n\nLicensed under GPLv3\n\n.. |Build Status| image:: https://travis-ci.org/mfalesni/selenium-smart-locator.svg\n :target: https://travis-ci.org/mfalesni/selenium-smart-locator\n.. |Coverage Status| image:: https://coveralls.io/repos/mfalesni/selenium-smart-locator/badge.svg\n :target: https://coveralls.io/r/mfalesni/selenium-smart-locator\n.. |Code Health| image:: https://landscape.io/github/mfalesni/selenium-smart-locator/master/landscape.svg?style=flat\n :target: https://landscape.io/github/mfalesni/selenium-smart-locator/master\n :alt: Code Health", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mfalesni/selenium-smart-locator", "keywords": "locator,selenium", "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "selenium-smart-locator", "package_url": "https://pypi.org/project/selenium-smart-locator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/selenium-smart-locator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mfalesni/selenium-smart-locator" }, "release_url": "https://pypi.org/project/selenium-smart-locator/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "A (somewhat) smart locator class for Selenium.", "version": "0.2.0" }, "last_serial": 3665718, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f77462fed63d39c9be650f8cf596f27e", "sha256": "2778b4b0c661927fde93fbdcbf354d84fee617842e005d84ae9c9a469f527f76" }, "downloads": -1, "filename": "selenium-smart-locator-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f77462fed63d39c9be650f8cf596f27e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18548, "upload_time": "2016-05-19T18:07:38", "url": "https://files.pythonhosted.org/packages/c0/e4/2b66bf043f0490023832b5ad9c72a15294879fb2f8e14d3f820e8a90e3d5/selenium-smart-locator-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4c5e216faa26d18c1b652e5c11ff04ec", "sha256": "dc32c0cb168ea6819b76a01e8ee62d8b26de298550d562da72c60e1c1c8bbc4a" }, "downloads": -1, "filename": "selenium-smart-locator-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4c5e216faa26d18c1b652e5c11ff04ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19000, "upload_time": "2016-05-20T12:02:31", "url": "https://files.pythonhosted.org/packages/38/a3/acc4de2a5ea80c676ba41efc5606dc70d2694c71551178792b963f72ee81/selenium-smart-locator-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "eefe82e45ba8026c9c1d2f82100d1b09", "sha256": "0fddfa238e3ddfd1808cbe487e0795c780dec1c50c9ccd79cff34075fd4caf68" }, "downloads": -1, "filename": "selenium-smart-locator-0.2.0.tar.gz", "has_sig": false, "md5_digest": "eefe82e45ba8026c9c1d2f82100d1b09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19108, "upload_time": "2017-04-07T11:55:46", "url": "https://files.pythonhosted.org/packages/e4/b7/07e0ef373ac9ab241d0cde3fff6e1feec98008e58b56ecda0d907a1c51c5/selenium-smart-locator-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eefe82e45ba8026c9c1d2f82100d1b09", "sha256": "0fddfa238e3ddfd1808cbe487e0795c780dec1c50c9ccd79cff34075fd4caf68" }, "downloads": -1, "filename": "selenium-smart-locator-0.2.0.tar.gz", "has_sig": false, "md5_digest": "eefe82e45ba8026c9c1d2f82100d1b09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19108, "upload_time": "2017-04-07T11:55:46", "url": "https://files.pythonhosted.org/packages/e4/b7/07e0ef373ac9ab241d0cde3fff6e1feec98008e58b56ecda0d907a1c51c5/selenium-smart-locator-0.2.0.tar.gz" } ] }