【发布时间】:2018-12-20 15:57:08
【问题描述】:
我想将 jenkins 所需的功能传递给酱汁实验室
我已经用 python 编写了我的代码
desired_caps = {}
desired_caps['platform'] = os.getenv('platform','SELENIUM_PLATFORM')
desired_caps['browserName'] = os.getenv('browserName','SELENIUM_BROWSER')
desired_caps['version'] = os.getenv('version','SELENIUM_VERSION')
context.browser = webdriver.Remote(
command_executor='http://USER_NAME:KEY@ondemand.saucelabs.com:80/wd/hub',
desired_capabilities=desired_caps)
在运行构建时在 jenkins 上出现此错误:
Starting pre-build for Sauce Labs plugin
Finished pre-build for Sauce Labs plugin
$ cmd /c call C:\WINDOWS\TEMP\jenkins6037287030698812464.bat
selenium.common.exceptions.WebDriverException: Message: Misconfigured --
Unsupported OS/browser/version/device combo: OS: 'SELENIUM_PLATFORM',
Browser: 'selenium_browser', Version: 'SELENIUM_VERSION.', Device:
'unspecified'
Executing before all - creating benemax admin with owner permission to use it
everywhere
User data: {}
Exception WebDriverException: Message: Misconfigured -- Unsupported
OS/browser/version/device combo: OS: 'SELENIUM_PLATFORM', Browser:
'selenium_browser', Version: 'SELENIUM_VERSION.', Device: 'unspecified'
C:\Program Files (x86)\Jenkins\workspace\project>exit 1
Build step 'Execute Windows batch command' marked build as failure
Starting post-build for Sauce Labs plugin
Updating the custom data field for jobs with Jenkins build info for analytics
Stopped/completed/updated 0 jobs
Finished post-build for Sauce Labs plugin
Starting Sauce Labs test publisher
The Sauce OnDemand plugin is configured, but no session IDs were found in the
test output.
Finished Sauce Labs test publisher
Finished: FAILURE
【问题讨论】:
标签: python-3.x selenium jenkins automated-tests saucelabs