51Testing软件测试论坛

标题: python编写selenium脚本,导入了SwitchTo但是在运行时报错 [打印本页]

作者: momochuhu    时间: 2015-8-10 13:34
标题: python编写selenium脚本,导入了SwitchTo但是在运行时报错
python编写selenium脚本,导入了SwitchTo但是在运行时报错:TypeError: 'SwitchTo' object is not callable

代码如下:
from selenium import selenium
from selenium import webdriver
import time
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.remote.webdriver import SwitchTo

......

driver.switch_to()
writeMail = driver.find_element_by_css_selector("li[id = 'xxxxx'][class = xxxxx']")
writeMail.click()
time.sleep(6)





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2