【问题标题】:Trying to launch url in Edge with IE compatability mode using robotframe work python尝试使用机器人框架python以IE兼容模式在Edge中启动url
【发布时间】:2022-10-18 13:26:15
【问题描述】:

我正在尝试使用机器人框架 python 在 IE 兼容模式下在 Edge 中启动 url,我正在使用下面的代码但收到此错误AttributeError:“选项”对象没有属性“attach_to_edge_chrome”.有人可以帮忙吗

使用的代码:

打开浏览器 url 即 options=ignore_zoom_level=True;attach_to_edge_chrome=True; edge_executable_path="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"

【问题讨论】:

  • 什么版本的边缘?什么操作系统?从 2022 年 6 月 15 日开始,某些版本的 Windows 10 将不再支持 Internet Explorer 11。
  • 您是否有任何特殊原因必须附加到 Edge 上?使用 Firefox 可能会取得更大的成功
  • 我测试了你的代码,它运行良好。您使用的是robotframeworkSeleniumLibrary 的哪个版本?您使用的是哪个版本的 IE WebDriver、Edge 浏览器和 Edge WebDriver?
  • 我正在使用这些版本@YuZhou -----robot framework-4.1.3、selenium-4.0.0、robotframework-seleniumlibrary 4.5.0、IEdriver 4.5.0、Edge browser-106.0、
  • 我使用最新版本的robotframework 5.0.1SeleniumLibrary 6.0.0。请更新到最新版本并再次测试。

标签: python-2.7 internet-explorer robotframework microsoft-edge ride


【解决方案1】:

您可以使用Maximize Browser Window 最大化浏览器窗口。请参考下面的示例代码(您可以将路径更改为自己的):

*** Settings ***
Library   SeleniumLibrary

*** Variables ***
${IEDriver}  E:/webdriver/IEDriverServer.exe

*** Test Cases ***
Example Test
    Open Browser  https://www.google.com/  ie  executable_path=${IEDriver}  options=ignore_zoom_level=True; attach_to_edge_chrome=True; edge_executable_path="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
    Maximize Browser Window

【讨论】:

    猜你喜欢
    • 2016-08-11
    • 1970-01-01
    • 1970-01-01
    • 2019-04-19
    • 1970-01-01
    • 2011-05-15
    • 2017-10-19
    • 2021-04-13
    • 1970-01-01
    相关资源
    最近更新 更多