交互模式下具有 Selenium Web 驱动程序的 Service Fabric 本地集群

问题描述 投票:0回答:1

我在本地集群模式下运行具有 1 个节点的 Microsoft Service Fabric。 是否可以以某种方式从服务以交互模式启动 selenium chromedriver?

当我启动 selenium chromedriver 会话时,它似乎在无头模式下开始非交互或不可见。 (不确定)

selenium-chromedriver azure-service-fabric
1个回答
0
投票

我解决了这个问题,在调试模式下启动 chrome,并将 chrome 驱动程序从服务附加到它。

步骤:

1。在调试模式下手动启动 Chrome 浏览器:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir=c:/tmp/selenium

2。使用 ChromeOptions 中的 DebuggerAddress 启动 Chromedriver

// chrome options            
ChromeOptions chromeOptions = new ChromeOptions();  

// set debugging address to chrome           
chromeOptions.DebuggerAddress ="127.0.0.1:9222" 

// start driver with options
IWebDriver driver = new ChromeDriver(chromeOptions)

然后,您可以在 chrome 窗口中观看步骤 1 中的所有 chromedriver 交互。

© www.soinside.com 2019 - 2024. All rights reserved.