【问题标题】:How can I use a fixed port for IEDriverServer.exe in Robot framework?如何在 Robot 框架中为 IEDriverServer.exe 使用固定端口?
【发布时间】:2017-12-19 17:29:58
【问题描述】:

我正在尝试使用 selenium 和 IEDriverServer 打开网页。问题是只有特定的端口是开放的。我需要在特定端口上运行驱动程序可执行文件。

【问题讨论】:

    标签: python selenium robotframework


    【解决方案1】:

    启动驱动程序时只需使用--port 开关。你可以看到可用的命令开关here

    【讨论】:

    • 我正在尝试如下最基本的代码: 打开浏览器xxxxxx.xxxxxx.com:19100/web/login.jsp 即单击元素 id=overridelink 我在哪里附加 --port 并切换。对不起,我对此很陌生。
    【解决方案2】:

    使用Create Webdriver 关键字可以将端口设置为参数:

    *** Settings ***
    Library    SeleniumLibrary
    
    Suite Teardown    Close All Browsers
    
    *** Test Cases ***
    Custom IE WebDriver port
    
        Create Webdriver    Ie   port=${7777}
        Go to     http://cnn.com
    
        Close Browser
    

    【讨论】:

      猜你喜欢
      • 2020-01-18
      • 1970-01-01
      • 2017-07-05
      • 2016-05-05
      • 2022-01-22
      • 1970-01-01
      • 2014-09-11
      • 2015-10-28
      • 2022-11-11
      相关资源
      最近更新 更多