```python
# -*- 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
from selenium.webdriver.support.select import Select
import unittest, time, re
url = "http://baidu.com"
class Pd(unittest.TestCase):
def setUp(self):
#self.driver = webdriver.Firefox()
#self.driver = webdriver.Ie()
#chromepath="C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe"
self.driver= webdriver.Chrome()
self.driver.implicitly_wait(30)
self.verificationErrors = []
self.accept_next_alert = True
def test_pd(self):
driver = self.driver
driver.get(url)
driver.find_element_by_id_name(“...").click
.
.
if __name__ == "__main__":
unittest.main()
selenium+python3 unittest 框架
最新推荐文章于 2023-08-26 15:15:05 发布