Selenium webdriver启动IE浏览器报错------windows

直接进入主题:
解决selenium webdriver 启动IE失败的方案:
IE: IEDriverServer.exe
一般常用的驱动,selenium 官网上都支持,这些都是浏览器厂家提供。
火狐:geckodriver.exe
谷歌:chromedriver.exe

一般推荐使用chrome驱动,一来是方便调试,二来是出错少。
步骤如下:
1.IE ---->工具 -----> Internet 选项
在这里插入图片描述
2.Internet 选项 — 安全 — 下面有四个部分可供点击选择
在这里插入图片描述
3.在红色标注的 4个部分 :Internet 本地 Intranet 受信任的站点 受限制的站点;逐渐选择对应下面的 保护模式 勾选框,这4个地方 要么全勾选,要么全不勾选,一般建议全选见下图:
在这里插入图片描述
4.此时重启执行程序:
我们看到IE 可以正常启动了。

附加一段代码效果图:
import os

proj_path = os.path.dirname(os.path.dirname(os.path.abspath(file)))
conf_path = os.path.join(proj_path,“config”,“Logger.conf”)

ie_driver_path = “e:\IEDriverServer”
chrome_driver_path = “e:\chromeDriver”
firefox_driver_path = “e:\geckoDriver”

test_data_file = os.path.join(proj_path,“TestData”,
“测试用例.xlsx”)
test_case_sheet = “测试用例”
test_case_test_step_sheet_name_col_no = 3
test_case_is_executed_col_no = 4
test_case_executed_time_col_no = 5
test_case_executed_result_col_no = 6
test_step_executed_exception_info_col_no = 8
test_step_executed_capture_pic_path_col_no = 9
test_step_action_col_no = 2
test_step_locate_type_col_no = 3
test_step_locate_expression_col_no = 4
test_step_value_col_no = 5
test_step_executed_time_col_no = 6
test_step_executed_result_col_no = 7

object_map_file_path = os.path.join(proj_path,“testdata”,“ObjectDeposit.ini”)
if name ==“main”:
print(conf_path)

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值