[Python] Robotframework custom libraries for UI Automation

Source: Internet
Author: User

1. Installation Tutorials

Environment building not much said, online information a large pile, can refer to https://www.cnblogs.com/puresoul/p/3854963.html, write more detailed, worth recommending. Currently Python3 is not supported ride so, with Python2

2. Create a project

& Projects under the directory, so that the file is more clear, as follows

& created well, it's time to write the script theme is UI Automation, so with the selenium library, there are other auxiliary libraries

,cd c:\Python27\Scripts\, execute easy_install pip, install good pip after dos execution, success is as follows, unsuccessful Baidu find the reason

& This time install the common library of UI Automation

Pip Install Selenium

Pip Install Pymysql

Pip Install Cx_oracle

3. Open Ride

& Open this ride.py to your local counterpart.

& After the look, I have the file already, if you don't, open the directory you created as a test suite to put

& Create a new test case--test test suite

& Create a test case on the test suite

4. Import Scripts

5. Script Implementation Ideas

& Define an Automation use case template, encapsulate the keyword, parameterize the implementation, so import the Main method testweb.py

6. Global variables and use case completion

&ride case Fill rule, perform method index to specified Excel

Add a New resource--a name- select robot Format file

Confirm ~

& Configuration under Variables and values

& Import global variable file-select the created file

& Using the Created variables

7. Assertions

& the Case method to return the actual and expected results, and then ride the self-contained assertion should contain determine if the two values have a relationship to be Pass/fail

8. Multithreaded running use cases

& Execute the following command to install Pabot ( Note the following Python version for example ):

Pip Install robotremoteserver==1.0.1

Pip Install robotframework-pabot==0.22

& After installation, execution ( number of threads )

Pabot--processes--outputdir Results Project path /

[Python] Robotframework custom libraries for UI Automation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.