# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re
class Untitled(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(30)
self.base_url = "https://www.hao123.com"
self.verificationErrors = []
self.accept_next_alert = True
print "cc" # 关注点1
#打开凤凰网链接
def test_feng(self):
driver = self.driver
driver.get(self.base_url + "/")
driver.find_element_by_link_text(u"凤 凰 网").click()
#打开淘宝网链接
def test_taobao(self):
driver = self.driver
driver.get(self.base_
python 初始化测试方法
最新推荐文章于 2023-04-19 16:59:43 发布