Robot框架-使用系统代理运行Firefox
好的,我得到了这个代码:Robot框架-使用系统代理运行Firefox,firefox,webdriver,selenium-webdriver,robotframework,Firefox,Webdriver,Selenium Webdriver,Robotframework,好的,我得到了这个代码: ${SERVER} http://www.google.pt/ ${BROWSER} firefox ${DELAY} 0 *** Keywords *** Open Browser To Google Open Browser ${SERVER} ${BROWSER} Maximize Browser Window Set Sel
${SERVER} http://www.google.pt/
${BROWSER} firefox
${DELAY} 0
*** Keywords ***
Open Browser To Google
Open Browser ${SERVER} ${BROWSER}
Maximize Browser Window
Set Selenium Speed ${DELAY}
在我运行关键词“打开浏览器到谷歌”后,firefox打开,甚至无法打开url。
我想我错过了办公室的代理,无法访问外部网络。
如何配置firefox webdriver以使用代理打开(系统默认)
Ty假设您使用的是Selenium2Library(而不是SeleniumLibrary),实现这一点的最简单方法是创建firefox配置文件,并将其作为参数传递给open browser关键字 1-创建Firefox配置文件 启动配置文件管理器
(Windows)firefox.exe-p
(OSX)/Applications/Firefox.app/Contents/MacOS/Firefox-bin -profilemanager
(Linux)/firefox-profilemanager
${SERVER} http://www.google.pt/
${BROWSER} firefox
${DELAY} 0
${FF_PROFILE} C:/ff_profile
*** Keywords ***
Open Browser To Google
Open Browser ${SERVER} ${BROWSER} ff_profile_dir=${FF_PROFILE}
Maximize Browser Window
Set Selenium Speed ${DELAY}
运行时,您的测试现在将使用此firefox配置文件并正确配置代理设置。当然,这种方法仅限于Firefox。在其他浏览器中运行会选择系统网络配置,因此这不应该是问题。我正在这样做,但ff请求用户名和密码。。。每次我运行测试时都要输入这些内容是很无聊的。。。我如何克服这个问题?