{ "info": { "author": "Scott Blevins", "author_email": "scottblevins@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Elemental\n=========\n\nA helpful wrapper for Selenium\n\n|Build Status|\n\nFull documentation can be located here:\nhttps://smeggingsmegger.github.io/WebElemental\n\nYou could use Elemental to scrape a website, automate web tasks, or\nanything else you could imagine. It is easy to initialize and use. It's\nalso compatible with\n`BrowserStack `__ using\nthe command\\_executor and remote\\_capabilities examples on that page.\nPlease note that you will need a subscription, username, and API key to\nmake it work.\n\n.. code:: python\n\n from WebElemental import Elemental\n\n # Running headless FireFox is the default.\n elemental = Elemental() # Defaults to xvfb=True, driver=FireFox\n # If xvfb is not installed, it will be bypassed automatically.\n\n # If you explicitly don't want headless operation:\n elemental = Elemental(xvfb=False)\n\nOnce we've initialized Elemental, we still need to kick off the browser.\nI've made this a manual step so that it is easy to start and stop\ndifferent browsers using the same Elemental instance if desired.\n\n.. code:: python\n\n # Start your engines...\n\n elemental.start()\n\n # DO SOME STUFF\n\n elemental.stop()\n\nLet's say you wanted to do some things in FireFox and then switch to\nChrome. You could do it like so:\n\n.. code:: python\n\n elemental = Elemental()\n\n elemental.start()\n\n # Do things...\n\n elemental.stop()\n\n # Change the browser. This is accomplished by setting the property directly at present.\n elemental.browser = \"Chrome\"\n\n # You could also choose to run headlessly if you wanted:\n elemental.xvfb = True\n\n elemental.start()\n\n # Do things in Chrome now.\n\n elemental.stop()\n\nThe main utility of the Elemental class is its ability to shortcut many\nof the most common tasks that you would need to automate the interaction\nwith a web page.\n\nThe most critical of these would be to open a webpage.\n\n.. code:: python\n\n elemental.go('http://someaddress.here/page.html')\n\nOnce we have a page open we can interact with it in various ways. The\nmethods in this class are well-documented so fully explaining them all\nis outside of the scope of this guide. I strongly recommend that you\nlook at the docstrings for all the methods and see for yourself how to\ninteract with them.\n\nHere is a list of available methods in Elemental with basic explanations\nabout what they do:\n\nBrowser control:\n~~~~~~~~~~~~~~~~\n\n- start\n- stop\n- refresh\\_page\n- forward\n- back\n- go\n- current\\_url\n- js\n\nScrolling\n^^^^^^^^^\n\n- scroll\\_browser\n\nMisc\n^^^^\n\n- get\\_page\\_source\n- screenshot\n- save\\_page\\_source\n\nWaiting\n^^^^^^^\n\n- wait\\_for\\_url\n- wait\\_for\\_title\n- wait\\_for\\_js\n\nFinding\n^^^^^^^\n\n- is\\_text\\_on\\_page\n\nElement Methods\n~~~~~~~~~~~~~~~\n\nScrolling\n^^^^^^^^^\n\n- scroll\\_to\\_element\n\nSelecting\n^^^^^^^^^\n\n- find\\_element\n- find\\_elements\n- get\\_element\n- get\\_elements\n- get\\_text\n- get\\_value\n- get\\_texts\n\nWaiting\n^^^^^^^\n\n- wait\\_for\n- wait\\_for\\_visible\n- wait\\_for\\_invisible\n- wait\\_for\\_all\\_invisible\n- wait\\_for\\_clickable\n- wait\\_for\\_selected\n- wait\\_for\\_presence\n- wait\\_for\\_opacity\n- wait\\_for\\_text\n- wait\\_for\\_text\\_in\\_value\n- wait\\_for\\_value\n- wait\\_for\\_ko\n\nInteraction\n^^^^^^^^^^^\n\n- click\n- click\\_all\n- hover\n- send\\_key\n- clear\n\nForms\n^^^^^\n\n- fill\n- fill\\_form\n- set\\_value\n- set\\_selectize\n- set\\_select\\_by\\_value\n- set\\_select\\_by\\_text\n\n.. code:: python\n\n print(elemental.current_url())\n # outputs 'http://someaddress.here/page.html'\n\n elemental.click('#some-button') # Clicks a button.\n\n elemental.js('console.log(\"I am executing JS on the page!\");')\n\n elem = elemental.find_element('#my-id') # Returns a selenium element object\n\n elems = elemental.find_elements('.some-class') # Returns a list of selenium element objects\n\n form_data = {\n '#username': 'person',\n '#password': 'somepass'\n }\n elemental.fill(form_data) # Fills a form. Takes a dict of CSS keys and values.\n\n elemental.screenshot('/tmp/screenshot1.png')\n\nBrowserStack example:\n^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n from WebElemental import Elemental\n desired = {\n 'browser': 'Edge',\n 'browser_version': '13.0',\n 'os': 'Windows',\n 'os_version': '10',\n 'resolution': '1440x900'\n }\n elemental = Elemental(desired_capabilities=desired,\n command_executor='http://USERNAME:API_KEY@hub.browserstack.com:80/wd/hub',\n driver='Remote')\n elemental.start()\n elemental.go('http://google.com')\n elemental.set_value('#lst-ib', 'WebElemental')\n\nAs you can see, there is almost no reason to ever interact with the\nselenium browser object directly. This is by design. If you ever find\nyourself needing to, it means that you have uncovered a need that was\nunanticipated by the initial design of this utility.\n\nIf you are reading this, you are a programmer so it would be nice if you\nmade the method you require and sent a PR. The more people use and\ndevelop this framework, the better it will become.\n\nSo even though I don't recommend using it, you still have access to the\nselenium browser object.\n\n.. code:: python\n\n elemental.browser.find_elements_by_id('#some-id') # Use elemental.find_element instead.\n\n--------------\n\nTestElemental\n=============\n\nTestElemental inherits Elemental so it has all the same methods that\nElemental has but it adds some additional methods that are useful for\ntesting.\n\nHelpers\n~~~~~~~\n\n- goto\n- wait\n\nTesting Asserts\n~~~~~~~~~~~~~~~\n\n- assert\\_element\\_has\\_class\n- assert\\_not\\_found\n- assert\\_not\\_visible\n- assert\\_exists\n- assert\\_alert\\_present\n- assert\\_text\\_in\\_page\n- assert\\_visible\n- assert\\_text\\_not\\_in\\_page\n- assert\\_url\n- assert\\_alert\\_not\\_present\n- assert\\_text\\_in\\_elements\n- assert\\_text\\_in\\_element\n- assert\\_found\n- assert\\_element\\_contains\\_text\n- assert\\_value\\_of\\_element\n- assert\\_element\\_not\\_has\\_class\n\n.. |Build Status| image:: https://travis-ci.org/smeggingsmegger/WebElemental.svg?branch=master\n :target: https://travis-ci.org/smeggingsmegger/WebElemental\n\nFile 'CHANGES' not found.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/IntuitiveWebSolutions/WebElemental", "keywords": "Selenium,Testing", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "WebElemental", "package_url": "https://pypi.org/project/WebElemental/", "platform": "OS Independent", "project_url": "https://pypi.org/project/WebElemental/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/IntuitiveWebSolutions/WebElemental" }, "release_url": "https://pypi.org/project/WebElemental/1.4.5/", "requires_dist": null, "requires_python": null, "summary": "An elemental force for driving web pages using Selenium and Python.", "version": "1.4.5" }, "last_serial": 2212960, "releases": { "1.4.4": [ { "comment_text": "", "digests": { "md5": "f52001ef672154faec7bc6632852faa2", "sha256": "e16e88d6914f1e47c262003970a773ef3812a387889fd1ce84ec0d686753999f" }, "downloads": -1, "filename": "WebElemental-1.4.4.tar.gz", "has_sig": false, "md5_digest": "f52001ef672154faec7bc6632852faa2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17072, "upload_time": "2016-07-10T16:55:25", "url": "https://files.pythonhosted.org/packages/ba/9e/2694277ad57217bfd8e3fc50b31dae262a451cac37b9b1da8f3bb06bd1a7/WebElemental-1.4.4.tar.gz" } ], "1.4.5": [ { "comment_text": "", "digests": { "md5": "9f2c5f0d1ac9ce8361c81c98c918c0ea", "sha256": "616dd7fc20d68c83fd2dcf4962bc128df084dcc0a2fd40cabfad5b63fb6351e6" }, "downloads": -1, "filename": "WebElemental-1.4.5.tar.gz", "has_sig": false, "md5_digest": "9f2c5f0d1ac9ce8361c81c98c918c0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17063, "upload_time": "2016-07-10T17:08:47", "url": "https://files.pythonhosted.org/packages/d1/37/c12f83c93336a1bb9f443d4a95ea194fb86f28aaa57098889f9538d647c6/WebElemental-1.4.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9f2c5f0d1ac9ce8361c81c98c918c0ea", "sha256": "616dd7fc20d68c83fd2dcf4962bc128df084dcc0a2fd40cabfad5b63fb6351e6" }, "downloads": -1, "filename": "WebElemental-1.4.5.tar.gz", "has_sig": false, "md5_digest": "9f2c5f0d1ac9ce8361c81c98c918c0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17063, "upload_time": "2016-07-10T17:08:47", "url": "https://files.pythonhosted.org/packages/d1/37/c12f83c93336a1bb9f443d4a95ea194fb86f28aaa57098889f9538d647c6/WebElemental-1.4.5.tar.gz" } ] }