Python &引用;ie驱动程序的命令行服务器已停止工作;及;这是WebDriver服务器的初始起始页;错误
我正在尝试使用SeleniumWebDriver测试一个只能在InternetExplorer8中工作的系统 我已经下载了IE webdriver的最新版本和旧版本,但其中任何一个都不起作用。我在“Internet选项”上设置了安全配置,就像我在这里读到的一些答案和系统变量一样 我使用一些简单的URL(如www.google.com)进行了测试,以了解我的系统是否有问题,但同样的错误也会发生 我正在用Python编写脚本,下面有一个示例:Python &引用;ie驱动程序的命令行服务器已停止工作;及;这是WebDriver服务器的初始起始页;错误,python,selenium,internet-explorer-8,webdriver,Python,Selenium,Internet Explorer 8,Webdriver,我正在尝试使用SeleniumWebDriver测试一个只能在InternetExplorer8中工作的系统 我已经下载了IE webdriver的最新版本和旧版本,但其中任何一个都不起作用。我在“Internet选项”上设置了安全配置,就像我在这里读到的一些答案和系统变量一样 我使用一些简单的URL(如www.google.com)进行了测试,以了解我的系统是否有问题,但同样的错误也会发生 我正在用Python编写脚本,下面有一个示例: from selenium import webdriv
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.common.action_chains import ActionChains
import unittest, time, re
class testAccess(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Ie("C:\\PythonXX\\Drivers\\IEDriverServer.exe")
self.driver.implicitly_wait(30)
self.driver.maximize_window()
# URL
self.base_url = "http://www.google.com"
self.verificationErrors = []
self.accept_next_alert = True
def test_Logon(self):
driver = self.driver
driver.get(self.base_url + "/")
time.sleep(3)
driver.find_element_by_id("username").send_keys("username")
driver.find_element_by_id("password").send_keys("password")
driver.find_element_by_id("logIn").click()
time.sleep(5)
def is_element_present(self, how, what):
try: self.driver.find_element(by=how, value=what)
except NoSuchElementException as e: return False
return True
def is_alert_present(self):
try: self.driver.switch_to_alert()
except NoAlertPresentException as e: return False
return True
def close_alert_and_get_its_text(self):
try:
alert = self.driver.switch_to_alert()
alert_text = alert.text
if self.accept_next_alert:
alert.accept()
else:
alert.dismiss()
return alert_text
finally: self.accept_next_alert = True
def tearDown(self):
self.driver.quit()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
当我执行此脚本时,IE打开并返回消息“这是WebDriver服务器的初始起始页”。执行脚本时打开的控制台崩溃并返回错误:“ie驱动程序的命令行服务器已停止工作”
关于Selenium的文档听起来很清楚webdrivers的用法,但没有解释旧的InternetExplorer版本中的用法。我不知道我到底做错了什么,我已经读了很多没有帮助的答案。哦,对了!我解决了下载IEDriverServer(2.39)的第一个版本的问题 除此之外,我进行了上所述的必要配置
现在开始工作了!哈哈:)哦,对了!我解决了下载IEDriverServer(2.39)的第一个版本的问题 除此之外,我进行了上所述的必要配置
现在开始工作了!哈哈:)“你可以在两天内接受你自己的答案”。我以后再做,好吗?“你可以在两天内接受你自己的答案”。我以后再做,好吗?