我使用以下示例向Selenide和Selenium添加代理 browsermob 。 我使用了这个link。
我用Eclipse运行它,我成功运行它。但当我用 Maven 尝试时。我有以下错误:
location:package net.lightbody.bmp.proxymaven找不到符号 符号:类ProxyServer
我的Pom.xml:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>3.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
答案 0 :(得分:0)
Short answer: Replace the browsermob-core
dependency with browsermob-core-legacy
, and your code will compile and run.
Long answer: BrowserMob Proxy has been almost completely rewritten using LittleProxy, which is faster, more stable, and supports more features than the legacy code you're currently using. I highly recommend upgrading to the new implementation; see the readme on github,以获取有关新界面的信息。
至少,我鼓励你使用&#34;传统适配器&#34;使用LittleProxy实现包装旧ProxyServer接口的类。有关详细信息,请参阅readme。