【发布时间】:2018-12-20 11:08:08
【问题描述】:
我正在尝试使用 LocalHost 和端口 8080 的代理。 我在 Robot Framework 中编写了以下代码,但是一旦浏览器打开,IP 就不会改变:
*** Settings ***
Documentation This is a simple test with Robot Framework
Library Selenium2Library
*** Variables ***
${SERVER} http:/demo.testfire.net
${BROWSER} firefox
${DELAY} 0
*** Keywords ***
Open Browser To Demo
${proxy}= Evaluate sys.modules['selenium.webdriver'].Proxy() sys, selenium.webdriver
${proxy.http_proxy}= Set Variable localhost:8080
Create Webdriver Firefox proxy=${proxy}
Go To ${Server}
*** Test Cases ***
Valid Login
Open Browser To Demo
谁能在不使用 Firefox 配置文件的情况下解决此问题,以便 Firefox 中的 IP 地址更改为 127.0.0.1?
【问题讨论】:
标签: python python-3.x robotframework selenium2library