示例:Open
Browser http://baidu.com Chrome
示例:Go To http://baidu.com
示例:
Click
Element id=Main
Click Element xpath=//div[@id="divLoading"]/img
示例:
Click
Link
//a[contains(.,'添加')]
也可以直接写//a[@href=””]
示例:Choose File xpath=//div[@id="divFiles"]/div[1]/input E:\\TestData\\1.jpg
示例:Clear Element Text xpath=//li[@id="test"]/div[3]/div[2]/span[1]/input
示例:Input Text xpath=//li[@id="Test"]/div[3]/div[2]/span[2]/input 星期一
示例:Confirm Action
示例:Execute JavaScript javascript:show_cate();
示例:
Wait Until Element Is Visible xpath=/html/body/div[1]/table/tbody/tr/td/div/div[2]/iframe 10s error=超时,请重试
示例:
Wait Until Element Is Enabled xpath=/html/body/div[4]/div/div/div[1]/div[1]/div[2] 20s error=等待门诊预约元素超时
示例:Focus id=names
示例:Select Frame xpath=/html/body/div[1]/table/tbody/tr/td/div/div[2]/iframe
示例:
@{windows}= list windows
select window ${windows}
@{location_list}= Create List A0 A-1
: FOR ${locator} IN Range @{location_list}
Log ${locator}
Take Screenshot ${locator}.jpg
示例:Mouse Click LEFT 696 383
示例:Mouse Click RIGHT 300 300
示例:Mouse Click Drag LEFT 300 300 600 600 Speed=1
Mouse Wheel DOWN 10
Mouse Wheel UP 7
此外,还有很多很多第三方库,主要的浏览器和页面元素的操作在“Selenium2Library”中。同时Robot Framework也支持自定义Library库(自定义Library在后续陆续更新哦)。