Before saying that I wrote a selenium automation framework, and then study the lower RF, I think the RF based on the keyword-driven framework is more easy to get started, of course, do some of the more cumbersome verification, it seems not too flexible, It's better to write a few lines of Python's benefits (or maybe you haven't mastered it yet), but overall, there's a good ride interface, easy to get started for people without programming basics, and it's a great way to learn
(i) Introduction to the Robot framework
The robot framework is a common open-source testing framework that supports keyword-driven, BDD-enabled case in tabular form and can test multiple types of clients or interfaces at the same time for distributed test execution. Can be used for many rounds of acceptance testing and acceptance test-driven development (ATDD), RF itself also has a rich built-in basic library, in addition to good extensibility, can expand a variety of external libraries (robotframework-appiumlibrary/ Robotframework-seleniumlibrary/robotframework-requests and so on, specifically to search Https://pypi.python.org/pypi?%3Aaction=search &term=robotframework&submit=search).
(ii) Robot framework installation
1, install Python: recommended to install Python 2.7; https://www.python.org/downloads/.
2. Set Environment variables (computer-Properties-Advanced system settings-environment variables-system variable-path, write C:\Python27 and C:\Python27\Scripts (change to the path you specify).
3, install Pip: now get-pip.py; https://pip.pypa.io/en/latest/installing/#id7 then cmd under Python get-pip.py
Python get-pip.py
4. Install the robot Framework: Execute sequentially under cmd
pip install robotframeworkpip install robotframework-ridepip install robotframework- Appniumlibrarypip Install robotframework-selenium2librarypip install robotframework-requests
5, start ride.py under CMD, will prompt missing Wxpython
Then download and install WXPYTHON:HTTP://SOURCEFORGE.NET/PROJECTS/WXPYTHON/FILES/WXPYTHON/2.8.12.1/Select the same as your Python version, install directly, For example (Wxpython2.8-win32-unicode-2.8.12.1-py27.exe), and then start ride.py
We can start ride.
(iii) creation of a simple RF project
1. Create a test project: Select the menu bar File->new project, enter the project name, select directory type, and select Catalog.
2. Create a test suite: Right-click the test project, select New Suit, enter name, and select File type.
3. Create test Case: Right-click Testsuite, select New test case, enter name.
4, import the relevant library, such as Selenium2library, click Testsuite, add Library at import, enter selenium2library
5. Editing test Cases
testcase1[setup]open Browser http://gouwu.sogou.comWait Until Page Contains Element ID' Tome Out ' Input Text id=upquery phone click Button id=searchbuttonclose Browser[teardown] Close all browsers
Tick new case, run, ok!
about how RF uses variables, validations, etc., will be explained in detail later
"Robot Framework" Robot framework Learning and selenium, appnium practices