Robot Framework Automated Testing Frameworks (ii): Web Automation

Source: Internet
Author: User
Tags xpath

Summary:
Web automation is inseparable from selenium, of course, the robot framework is the same, combined with selenium, need to install: Pip install Selenium2library, accustomed to coded write web automation, robot The framework's tool for keyword automation is also OK, making testing easier.

Body:

1. Element positioning:
1.1 ID or name locator
1.2 XPath positioning
1, the absolute path of XPath:
Xpath =/html/body/div[1]/div[4]/div[2]/div/form/span[1]/input
2. The relative path of XPath:
Xpath =//*[@id = ' kw1 ')

1.3 CSS Positioning

2. Common Selenium API
2.1 Open the browser: Open Browser
2.2 Close browser: Close Browser
2.3 Close all browsers: Close all Browsers
2.4 Browser maximization: Maximize Browser Window
2.5 setting Browser width, height: Get Window Size
2.6 Text input: input text
2.7 Click elements: click Element
2.8 Click buttons: Click button
2.9 Comment: # comment Content
2.10 Fixed-time hibernation: Sleep (unit: seconds)
2.11 Wait elements appear on the current page: Wait Until page Contains element
2.12 Get Title:get Title
2.13 Getting text information: get-text
2.14 Get element attribute value: Get-Element Attribute
2.15 Cookie Processing: Get cookies
2.16 Declaring variables: ${a}
2.17 log (output): Log
2.18 Get browser window width, height: Get window size
2.19 dropdown Box Selection: Unselect from List by Value

3. Automated test-assertion judgment (after running Python ride.py, press F5 for keyword query)
Assertion judgment is an essential part of automation, and the RF Selenium2library contains the following major assertions:

Summary:
This article has to be hastily finished, recently in the Java + Selenium + Jenkins + Maven + testlink Web automation, RF pause for a while, and so I am free to see how RF for Android and iOS automation.

Reference Documents:
Robot Framework Automation Test (iii)-selenium API

I use Bootstrap + Easyui + Django Development website: http://www.xuyangting.com/Welcome to visit

Balcony test: 239547991 (group number)

Robot Framework Automated Testing Frameworks (ii): Web 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.