selenium 带框架测试代码

from selenium import webdriver
import unittest
import time
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
# firfoxdriver 为 你的firefox安装路径
class GloryRoad(unittest.TestCase):
    def setUp(self):
        self.driver=webdriver.Firefox(executable_path='C:geckodriver')
    def testSoGou(self):
        self.driver.get('http://www.163.com')
        print(self.driver.current_url)
    def tearDown(self):
        self.driver.quit()
if __name__=='__main__':
    unittest.main()

  

原文地址:https://www.cnblogs.com/zj0724/p/8483303.html