gpt4 book ai didi

amazon-ec2 - Google ChromeDriver 无法在 EC2 服务器的 xvfb 中运行,一旦调用 sendkeys() 就会出错

转载 作者:行者123 更新时间:2023-12-03 08:14:04 28 4
gpt4 key购买 nike

当我尝试运行 selenium 代码以启动 chrome 驱动程序并测试 EC2 Box 中的登录功能时出现以下错误。

我像这样在另一个终端中运行 Xvfb 服务器 Xvfb :1 -screen 0 1366x768x24 -ac .

我还添加了 export DISPLAY=:1/usr/bin/google-chrome-stable
基本上我正在尝试在此链接上测试登录功能:https://talentconnect.pge.com/sap/bc/webdynpro/sap/hrrcf_a_startpage_ext_cand?sap-wd-configId=ZPERJ_STARTPAGE_EXT_CAND&sap-client=810

一旦代码命中 sendkey()调用登录凭据会出现此错误。

错误日志:

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: an X display is required for keycode conversions, consider using Xvfb
(Session info: chrome=31.0.1650.63)
(Driver info: chromedriver=2.8.240825,platform=Linux 3.2.0-36-virtual x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 83 milliseconds
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-36-virtual', java.version: '1.7.0_25'
Session ID: 9e7150582926e064d5c93c97a87b9008

最佳答案

更新 Selenium 和 ChromeDriver:docs.seleniumhq.org/downloadchromedriver.storage.googleapis.com/index.html .正确的版本是主要必要的。

关于amazon-ec2 - Google ChromeDriver 无法在 EC2 服务器的 xvfb 中运行,一旦调用 sendkeys() 就会出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21309146/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com