舉個例
Python
from selenium import webdriver
driver = webdriver.Chrome()
driver.get(‘http://yourhost.com’)
element = driver.find_element_by_id(‘THE_ID’)
element.send_keys(‘VALUE’)
element = driver.find_element_by_xpath(‘THE_XPATH’)
element.click()
Robot framework
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Open browser and run
Open Browser http://yourhost.com chrome
Wait Until Element Is Visible id=THE_ID
Input Text id=THE_ID VALUE
Wait Until Element Is Visible xpath=THE_XPATH
Click Element xpath=THE_XPATH
完全keyword driven 可擴展性超強