selenium.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:Py 作者: LockGit 项目源码 文件源码
def test_search(self):
        driver = self.driver
        driver.get("http://www.baidu.com")
        self.assertIn(u"????", driver.title)
        elem = driver.find_element_by_id("kw")
        elem.send_keys("php")
        elem.send_keys(Keys.RETURN)
        i = 0
        while 1:
               if i>=2:
                    break
               time.sleep(1)
               i+=1
               print "not test %s , wait %s second continue ..." % ('php',i,)
        assert "No results found." not in driver.page_source
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号