#!usr/bin/env python #-*- coding:utf-8 -*- #禁用IE的保护模式 from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import unittest,time class TestDemo(unittest.TestCase): def setUp(self): caps = DesiredCapabilities.INTERNETEXPLORER caps[‘ignoreProtectedModeSettings‘] = True self.driver = webdriver.Ie(capabilities=caps) def test_cliseTheIEProtectedMode(self): self.driver.get(‘http://www.baidu.com‘) time.sleep(3) def tearDown(self): self.driver.quit() if __name__ == ‘__main__‘: unittest.main()
原文地址:https://www.cnblogs.com/sleeping-cat/p/8278791.html
时间: 2024-11-20 16:07:26