Python Selenium Exception AttributeError:“’Service’对象
发布时间:2020-12-16 23:15:14 所属栏目:Python 来源:网络整理
导读:我有一个Selenium Python测试套件.它开始运行,但在几分钟后,抛出以下错误: Exception AttributeError: "'Service' object has no attribute 'process'" in bound method Service.__del__ of selenium.webdriver.ie.service.Service object at 0x00000000026
我有一个Selenium
Python测试套件.它开始运行,但在几分钟后,抛出以下错误:
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.ie.service.Service object at 0x0000000002610DD8>> ignored 我的测试套件实现是: import unittest from HTMLTestRunner2 import HTMLTestRunner import os import Regression_TestCase.RegressionProject_TestCase2 # get the directory path to output report file #result_dir = os.getcwd() result_dir = r"E:test_runnersselenium_regression_test_5_1_1ClearCore - Regression TestTestReport" # get all tests from SearchProductTest and HomePageTest class search_tests = unittest.TestLoader().loadTestsFromTestCase(Regression_TestCase.RegressionProject_TestCase2.RegressionProject_TestCase2) # create a test suite combining search_test re_tests = unittest.TestSuite([search_tests]) # open the report file outfile = open(result_dir + "TestReport.html","w") # configure HTMLTestRunner options runner = HTMLTestRunner.HTMLTestRunner(stream=outfile,title='Test Report',description='Smoke Tests') # run the suite using HTMLTestRunner runner.run(re_tests) 任何人都可以帮助为什么这个错误阻止我的测试套件运行?我该如何解决? 解决方法
如果您已经安装了selenium,并且假设在控制台的追溯记录中,您的脚本中还有一些类似“’chromedriver’可执行文件需要在PATH中”,您应该可以做到:
from selenium import webdriver driver = webdriver.Chrome("/path/to/chromedriver") 这应该告诉你的脚本哪里可以找到chromedriver.在Mac上,通常可以使用:/usr/local / bin / chromedriver (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |