#coding=utf-8
from selenium import webdriver
‘‘‘
测试简单元素操作
‘‘‘
url="http://www.126.com/"
driver=webdriver.Firefox()
driver.get(url)
driver.find_element_by_xpath(".//*[id=‘login-form‘]//[@class=‘j-inputtext dlemail‘]").clear()
driver.find_element_by_xpath(".//*[@class=‘j-inputtext dlemail‘]").send_keys("18210558203")
driver.find_element_by_class_name("j-inputtext dlpwd").clear()
driver.find_element_by_class_name("j-inputtext dlpwd").send_keys("waxq1314")
driver.find_element_by_id("dologin").click()
#driver.quit()