pythonwebdriver';当对象不存在时,s is_元素_present不起作用

pythonwebdriver';当对象不存在时,s is_元素_present不起作用,python,webdriver,Python,Webdriver,使用selenium ide录制后,我在代码中获得了以下方法: def is_element_present(self, how, what): try: self.driver.find_element(by=how, value=what) except NoSuchElementException, e: return False return True 当对象存在时,它工作正常: print self.is_element_pre

使用selenium ide录制后,我在代码中获得了以下方法:

def is_element_present(self, how, what):
    try:
        self.driver.find_element(by=how, value=what)
    except NoSuchElementException, e:
        return False
    return True
当对象存在时,它工作正常:

print self.is_element_present("id","kw")
我明白了

但当对象不存在时:

print self.is_element_present("id","kw1")

在很长一段时间里(比self.driver.implicitly_wait(30))我一无所获

首先要检查的是webdriver和firefox版本的兼容性。FF16与2.25 for java配合使用效果良好。我认为2.26也支持17。每个版本都有哪些版本


编辑:对于python更改日志,除了FF13之外没有其他内容:

看起来我的操作系统或Firefox浏览器有问题,这种方法在win7下的Ie和Chrome以及ubuntu下的Firefox中都能正常工作。但在win7下,它仍然不能与我的Firefox一起工作。