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