Hello all,
In this gist you may find resources in Russian/English which could be useful for writing Python script for test automation tasks.
While Python 3.x (>=3.3) is reccomended for new project development it much better and easier to go with a bit older but rock-solid Python 2.x (>=2.7) for test automation.
Some Python packages comes with binary modules and it much easier to use 32-bit Python under Windows due to this reason.
Python installation includes very good set of standard libraries.
Majority of third-party libraries could be found at PyPI (Python Package Index) - https://pypi.python.org/pypi/simplegui
NOTE that all third party libraries in Python are called 'packages'.
pip or easy_install tools should be used in order to install Python package.
NOTE that both pip and easy_install can not install packages with binary modules without C/C++ compiler on Windows.
In such cases you can download such packages with already compiled modules from here:
Gallery of Python packages which contains binary modules. Complied for Windows - http://www.lfd.uci.edu/~gohlke/pythonlibs/
For example, this package can not be installed using pip - https://pypi.python.org/pypi/MySQL-python/1.2.4
So, you can download and install package using following url - http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
Unit/integration tests. Use pytest instead of unittest module or nose package - https://pypi.python.org/pypi/pytest
HTTP protocol. Use requests instead of httplib, urllib, urllib2 or urllib3 - https://pypi.python.org/pypi/requests
Web Browser drivers. Selenium WebDriver for Python - https://pypi.python.org/pypi/selenium
HTML parsing, XML parsing, XML writing - https://pypi.python.org/pypi/lxml/3.2.1
JSON parsing/writing - http://docs.python.org/2/library/json.html
MySQL database access - https://pypi.python.org/pypi/MySQL-python/1.2.4
Check email (IMAP protocol) - http://docs.python.org/2/library/imaplib.html
Send email (SMTP protocol) - http://docs.python.org/2/library/smtplib.html
PEP8 коротко и по-русски - Блог - http://rukeba.com/by-the-way/pep8-korotko-i-po-russki/
NOTE: Fresh version of PyCharm will check your code against PEP8 guidelines automatically.
Code Like a Pythonista: Idiomatic Python (part0) / Хабрахабр - http://habrahabr.ru/post/88972/
Code Like a Pythonista: Idiomatic Python (part1) / Хабрахабр - http://habrahabr.ru/post/89735/
Code Like a Pythonista: Idiomatic Python (part2) / Хабрахабр - http://habrahabr.ru/post/90493/
Стиль кода в языке python - https://docs.google.com/file/d/0B7cDWj1-Z0r0MmYwZjJhZWEtMjk1Zi00NWE5LWEzNTQtOTFjNjcwYjdhMGRl/edit?pli=1&hl=ru
The Hitchhiker’s Guide to Python! - https://python-guide.readthedocs.org/en/latest/
-
XPATH selectors. IMO better to learn this because it's more poverful (and also a bit more complicated that CSS selectors)
-
CSS selectors
- Put some books/references for novices and beginners in programming
- Fix some formatting issues
- Put references on XPATH and CSS selectors