【发布时间】:2020-08-03 01:41:34
【问题描述】:
谁能帮助我将 service_arg --log-path 传递给 ChromeDriver,以便在 RobotFramework 中启用和控制驱动程序日志的路径。当我尝试传递服务参数时,我开始收到错误。
我将发布两个结构相似的测试。`Chrome Log Tests
*** Settings ***
Library Selenium2Library
Library OperatingSystem
Library Collections
*** Variables ***
${URL} https://google.com
${Browser} Chrome
${path} D:\\Users\\x\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\chromedriver.exe
${chromelogs} D:\\Users\\x\\eclipse-workspace\\ChromeOptions\\jpg
*** Test Cases ***
Test 001
[Documentation] ChromeLog path
Create Webdriver ${Browser} executable_path=${path} service_args=["--log-path=${chromelogs}"]
Go To ${URL}
[Teardown] Close All Browsers
Test 002
[Documentation] Chrome options
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
Call Method ${chrome_options} add_argument version
Call Method ${chrome_options} add_argument disable-infobars
Call Method ${chrome_options} add_argument start-maximized
Create Webdriver Chrome chrome_options=${chrome_options} executable_path=${path} service_args=["--log-path=${chromelogs}"]
Go To ${URL}
[Teardown] Close All Browsers
【问题讨论】:
标签: selenium-chromedriver robotframework