{"id":19041056,"url":"https://github.com/everythingme/pyfrank","last_synced_at":"2025-07-27T15:42:44.677Z","repository":{"id":4918028,"uuid":"6074437","full_name":"EverythingMe/pyfrank","owner":"EverythingMe","description":"python binding for iOS automation using frank.","archived":false,"fork":false,"pushed_at":"2012-10-25T15:41:17.000Z","size":266,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T10:52:59.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"OCA/account-financial-reporting","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EverythingMe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-04T11:25:09.000Z","updated_at":"2021-11-19T13:22:26.000Z","dependencies_parsed_at":"2022-09-02T08:32:15.785Z","dependency_job_id":null,"html_url":"https://github.com/EverythingMe/pyfrank","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fpyfrank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fpyfrank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fpyfrank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fpyfrank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EverythingMe","download_url":"https://codeload.github.com/EverythingMe/pyfrank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250516287,"owners_count":21443595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T22:26:51.332Z","updated_at":"2025-04-23T21:26:10.817Z","avatar_url":"https://github.com/EverythingMe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyfrank - python binding for iOS automation using frank.\n==================================================\n\npyfrank is an API to interact with frank, the iOS automation framework.\n\n\n#Installation\n\nOption 1:\n\n1. Clone this repo or download the sources\n\n2. `cd pyfrank`\n\n3. `python setup.py build`\n\n4. `sudo python setup.py install`\n\nOption 2:\n\n`sudo pip install pyfrank`\n\n\n\n#It's that simple\n----------\n\n```python\nfrom pyfrank import *\n\n# We are running a simulator with frank locally on port 32765\ndevice = Device(host='127.0.0.1', port=32765)\n\n# Get the view representing a tab-bar button with the label \"Mail\"\nview = device.getView(UiQuery(\"tabBarButton\", {'marked': \"Mail\" }))\n\n# Touch the button\nresponse = view.touch()\n\nif isinstance(response, Success):\n    logging.info(\"Test mail button succeeded!\");\nelif isinstance(response, Failure):\n    logging.error(\"Test mail button failed: %s\", response)\n```\n\n#The object model\n----------\n\n## Device\nThe first entry point for interacting with frank. It's constructor receives the host and the port of the frank enabled device.\n\n\n###Example:\n```python\nfrom pyfrank import *\n\ndevice = Device(\"127.0.0.1\", 32765)\n    \n# Type text into the keyboard\ndevice.typeIntoKeyboard(\"abc\")\n\n# Execute a method \ndevice.appExec(\"methodSignature\", \"arg1\", \"arg2\", ...)\n\n# Get the accesibility state\naccessibilityEnabled = device.accessibilityCheck()\n\n# Get the device orientation\norientation = device.getOrientation()\nif orientation == Orientation.PORTRAIT:\n    print \"Portrait\"\nelif orientation == Orientation.LANDSCAPE:\n    print \"Landscape\"\n\n# Get the application layout graph\ndump = device.dump()\n```\n\n## UiQuery\nIn frank views can be found using a special query language called \"UiQuery\". \n\n###Example:\n```python\nfrom pyfrank import *\n\nUiQuery(\"view:'UIImageView' marked:'ProfilePicture'\")\n```\n\n* Additional documentation on UiQuery can be found here: http://code.google.com/p/uispec/wiki/Documentation#UIQuery\n\n\n## View\nView allows to perform operations on the view(s) that match a UiQuery.\n\n```python\n#Get the profile picture view\nview = device.getView(UiQuery({'view': 'UIImageView'}, {'marked': 'ProfilePicture'}))\n\n#Flash the profile picture\nr = view.flash() \n\n#Test for success\nif isinstance(r, Success):\n    print \"Flashed the profile picture!\"\nelse:\n    print \"Failed flashing profile picture\"\n\n#Touch the profile picture\nr = view.touch()\n\n\n#Get the title text input view\ninput = device.getView(UiQuery({'view', 'UITextField'}, {'marked': 'Title'}))\n    \nr = input.setText(\"New title text\")    \n\nif isinstance(r, Success):\n    print \"Title input was changed successfully.\"\nelse:\n    print \"Failed changing title input\"\n```\n\n## Retrieve a view property\n```python\nview = device.getView(UiQuery({'view':'UILabel'}, { 'marked':'Pull down to refresh...' }))\n\n# \n# Pull out the 'text' attribute.\nr = view.text()\n\nif isinstance(r, Success):\n    labelText = r['results'][0]\n\n    print \"The text of the UILabel is\", labelText\nelse:\n    print \"I seriously failed to retrieve the UILabel text attribute\", r\n```\n\n## Take a screenshot\n```python\ndevice.screenshot(fileName='snapshot.jpg')\n```\n\n## Run javascript code inside a WebView\n```python\nview = device.getView(UiQuery('webView', { 'index':0 }))\n\n# Fetch the URL from JS\nurl = view.stringByEvaluatingJavaScriptFromString('location.href').results()[0]\nprint \"URL:\", url\n\n# Pop up an alert box\nview.stringByEvaluatingJavaScriptFromString(\"alert('Hello from pyfrank!')\")\n```\n\n#More information on frank\n----------\nhttp://testingwithfrank.com/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverythingme%2Fpyfrank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverythingme%2Fpyfrank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverythingme%2Fpyfrank/lists"}