Selenium 测试

from selenium import selenium
import unittest, time, re

class NewTest(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium(“localhost”,
4444, “*chrome”, “http://shell.appspot.com”)
self.selenium.start()

def test_new(self):
sel = self.selenium
sel.open(“/”)
sel.click(“link=source”)
sel.wait_for_page_to_load(“30000”)

def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)

if __name__ == “__main__”:
unittest.main()

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注